Surrounding yourself with good friends certainly helps. Reading Qur'aan and performing Salat does as well. Good deeds in general do, and not just standard forms of worship, but also getting involved in helping others. Learning also helps a lot. It keeps you not only near good people, but learned ones as well. You can see things in a more positive way, as your discovering of your current life is mercy from Allah.
In Sahih Al Bukhari, among the seven who are granted shade by Allah, is " A person who remembers Allah in seclusion and his eyes become flooded with tears.”
So its not necessarily a bad thing, if you turn it into positive energy.
Prophet Muhammad (peace be upon him) said: “I swear by Him in whose hand is my soul, if you were a people who did not commit sin, Allah would take you away and replace you with a people who would sin and then seek Allah’s forgiveness so He could forgive them.” [Sahīh Muslim (2687)]
We are human and make mistakes, when we do we repent and regret. Are you a perfectionist? We cannot be perfect, but we do what we can, as religion in itself is really easy.
The Prophet Muhammad (peace be upon him) said: "Religion is very easy, and whoever overburdens himself in his religion will not be able to continue in that way. So you should not be extremists, but try to be near to perfection and receive the good tidings that you will be rewarded."
There is a hadith Qudsi (words of Allah swt)
"O son of Adam, as long as you call upon Me and put your hope in Me, I have forgiven you for what you have done and I do not mind. O son of Adam, if your sins were to reach the clouds of the sky and then you would seek My forgiveness, I would forgive you. O son of Adam, if you were to come to Me with sins that are close to filling the earth and then you would meet Me without ascribing any partners with Me, I would certainly bring to you forgiveness close to filling it."
Say: O My servants who have transgressed against their own souls, despair not of the mercy of Allah. Indeed, Allah forgives all sins. Truly, He is Most Forgiving, Most Merciful. (Surah az-Zumar 39:53)
Ibn Mas'ud narrated that the Prophet said:
“Indeed, Allah is more happy with the repentance of His slave than a man who stops in a barren, desolate land; with him he has his riding animal. He then goes to sleep. When he wakes up, [he realizes that] his mount is gone. He searches for it until he is on the verge of dying. He then says, ‘I will return to the place wherein I lost it, and I will die there.’ He went to that place, and he was then overcome by sleep. When he woke up, his mount was [standing] right beside his head: on it was his food, his drink, his provisions, and the things he neded. Allah is more happy with the repentance of his believing slave than the aforementioned man when he finds his mount and his provisions.”
[al-Bukhaari: 6308 ; Muslim: 2744]
Theres much written on Al-Tawbah repentance so you can read some for additional inspiration.