One way would be to consider this: You probably believe that God is perfect and that only God is perfect.
Therefore, you are basically telling yourself that in order to be accepted by God, you must actually be God, because if God only accepts perfection, then the only person God loves is God.
You have set yourself up to fail automatically by setting a goal that is unattainable, perfection. Because you cannot be perfect, no one can, you think you are unacceptable. Your belief in your unacceptability is the real source of the problem.
Until you believe that you are acceptable as you are, with all of your flaws and imperfections, you are just going to beat yourself up for not being perfect, which will mean beating yourself up for the rest of your life.
And it is rather doubtful that your religion really wants you to spend the rest of your life condemning yourself when you could be influencing others by your example of bettering yourself. To stop this obsession, seek help from a professional.