Constantly seek repentance from Allaah for He loves those who do so.
"…Indeed, Allah loves those who are constantly repentant and loves those who purify themselves."
Narrated Abu Huraira:
I heard Allah's Messenger (sallallaahu alayhi wa sallam) saying." By Allah! I ask for forgiveness from Allah and turn to Him in repentance more than seventy times a day."
[Sahih Al-Bukhaari Hadith No. 6307]
Even if your sins were to reach the clouds of the sky, Allaah would forgive you so long as you did not commit Shirk.
Anas bin Malik narrated that the Messenger of Allah (sallallaahu alayhi wa sallam) said:
“Allah, Blessed is He and Most High, said: ‘O son of Adam! Verily as long as you called upon Me and hoped in Me, I forgave you, despite whatever may have occurred from you, and I did not mind.
O son of Adam! Were your sins to reach the clouds of the sky, then you sought forgiveness from Me, I would forgive you, and I would not mind. So son of Adam! If you came to me with sins nearly as great as the earth, and then you met Me not associating anything with Me, I would come to you with forgiveness nearly as great as it.’”
[Jaami Al-Tirimidhi Hadith No. 3540]
Even if you sin again and again, do not lose hope. Keep asking Allaah to forgive you.
Abu Huraira reported from Allah's Messenger (sallallaahu alayhi wa sallam) that his Lord, the Exalted and Glorious, thus said. A servant committed a sin and he said:
O Allah, forgive me my sins, and Allah (the Exalted and Glorious) said: My servant committed a sin and then he came to realize that he has a Lord Who forgives the sins and takes to account (the sinner) for the sin.
He then again committed a sin and said: My Lord, forgive me my sin, and Allah, the Exalted and High, said: My servant committed a sin and then came to realize that he has a Lord Who would forgive his sin or would take (him) to account for the sin.
He again committed a sin and said: My Lord, forgive me for my sin, and Allah (the Exalted and High) said: My servant has committed a sin and then came to realize that he has a Lord Who forgives the sins or takes (him) to account for sin. O servant, do what you like. I have granted you forgiveness. 'Abd al-A'la said: I do not know whether he said thrice or four times to do" what you desire".
[Sahih Muslim Hadith No. 2758]
This is the best form of asking forgiveness.
Shaddad bin Aus (May Allah be pleased with him) said:
The Prophet (sallallaahu alayhi wa sallam) said, "The best supplication for seeking forgiveness (Syed-ul- Istighfar) is to say:
'Allahumma Anta Rabbi, la ilaha illa Anta, khalaqtani wa ana 'abduka, wa ana 'ala 'ahdika wa wa'dika mastata'tu, a'udhu bika min sharri ma sana'tu, abu'u laka bini'matika 'alayya, wa abu'u bidhanbi faghfir li, fa innahu la yaghfirudh-dhunuba illa Anta.
(O Allah! You are my Rubb. There is no true god except You. You have created me, and I am Your slave, and I hold to Your Covenant as far as I can. I seek refuge in You from the evil of what I have done. I acknowledge the favors that You have bestowed upon me, and I confess my sins. Pardon me, for none but You has the power to pardon).'
He who supplicates in these terms during the day with firm belief in it and dies on the same day (before the evening), he will be one of the dwellers of Jannah; and if anyone supplicates in these terms during the night with firm belief in it and dies before the morning, he will be one of the dwellers of Jannah."
If you ask forgiveness with the following words mentioned in the Hadith, even your major sins can be forgiven.
Bilal bin Yasar bin Zaid [the freed slave of the Prophet(sallallaahu alayhi wa sallam)] narrated:
“My father narrated to me, from my grandfather, that he heard the Prophet (sallallaahu alayhi wa sallam) say: ‘Whoever says: “I seek forgiveness from Allah, the Magnificent, whom there is none worthy of worship but Him, the Living, Al-Qayyum, and I repent to him,”
(Astaghfirullāhal-`Aẓīm alladhī lā ilāha illā huwal-Ḥayyul-Qayyūmu wa atūbu ilaih)
then Allah will forgive him, even if he fled from battle.’”
[Jaami’ Al-Tirmidhi Hadith No. 3577]
Fleeing from battle is a major sin.