If let say I pray, fast, recite Quran regularly and everything but still sometimes I do wrong act accidentally and some purposely especially when dealing with other gender. Now I keep on thinking that all the good act I am performing is cursing me due to my poor behavior in avoiding the wrong act. What should I do. I am very weak especially when dealing with girls. Can you give me some advice how to go away with my bad attitude? I always listening to surah anbiyya as if the first verse is reminding me my behavior.

Watch Allah.

Watching Almighty differs from remembering.
Watching means that you notice that he see what you are doing.
Suppose your father is with you, are you going to do a bad thing?