How to Repent in Islam
Question

I have committed many sins which no one knows of except Allah. What do I have to do so that Allah will accept my repentance?
Praise be to Allah.To err is human 
A Muslim’s faith may become weak and he may be overwhelmed by his desires. The Shaytan may make sin attractive to him, so he wrongs himself (commits sin) and falls into that which Allah has forbidden. But Allah is Kind to His slaves, and His mercy encompasses all things. Whoever repents after doing wrong, Allah will accept his repentance , for Allah is Forgiving and Merciful. 
“But whosoever repents after his crime and does righteous good deeds (by obeying Allah), then verily, Allah will pardon him (accept his repentance). Verily, Allah is Oft Forgiving, Most Merciful [al-Maidah 5:39 – interpretation of the meaning]  
Allah is Forgiving and Generous. He commands all His slaves to repent sincerely so that they may gain the mercy of Allah and His Paradise. Allah says (interpretation of the meaning):  
“O you who believe! Turn to Allah with sincere repentance! It may be that your Lord will expiate from you your sins, and admit you into Gardens under which rivers flow (Paradise)” [al-Tahrim 66:8]  
The door of repentance is always open
The gate of repentance is open to His slaves, until the sun rises from the west. The Prophet (peace and blessings of Allah be upon him) said: “Allah spreads out His Hand at night to accept the repentance of those who did wrong during the day, and He spreads out His Hand during the day to accept the repentance of those who did wrong during the night. (This will continue) until the sun rises from the west.” (Narrated by Muslim, no. 2759) 
Conditions of repentance in Islam
Sincere repentance is not merely the matter of words spoken on the tongue. Rather, the acceptance of repentance is subject to the conditions that:

the person gives up the sin straight away, 
that he regrets what has happened in the past, 
that he resolves not to go back to the thing he has repented from, 
that he restores people’s rights or property if his sin involved wrongdoing towards others, and 
that he repents before the agony of death is upon him. Allah says (interpretation of the meaning): 

“Allah accepts only the repentance of those who do evil in ignorance and foolishness and repent soon afterwards; it is they whom Allah will forgive and Allah is Ever All-Knower, All-Wise.
And of no effect is the repentance of those who continue to do evil deeds until death faces one of them and he says: ‘Now I repent;’ nor of those who die while they are disbelievers. For them We have prepared a painful torment” [al-Nisa 4:17-18] 
Allaah accepts repentance and is Merciful. He calls sinners to repent, so that He might forgive them: 
“…your Lord has written (prescribed) Mercy for Himself, so that if any of you does evil in ignorance, and thereafter repents and does righteous good deeds (by obeying Allah), then surely, He is Oft-Forgiving, Most Merciful” [al-An’am 6:54 – interpretation of the meaning]  
Allah is Kind to His slaves and loves those who repent. He accepts their repentance, as Allah says (interpretation of the meaning): 
“And He it is Who accepts repentance from His slaves, and forgives sins, and He knows what you do” [al-Shura 42:25]
 “Truly, Allah loves those who turn unto Him in repentance and loves those who purify themselves” [al-Baqarah 2:222] 
Accepting Islam wipes away all past sins
When anon-Muslim becomes a Muslim, Allah turns his bad deeds (sayyiat) into good deeds (hasanat), and forgives him all his previous sins, as He says (interpretation of the meaning): 
“Say to those who have disbelieved, if they cease (from disbelief), their past will be forgiven” [al-Anfal 8:38] 
Allah is Forgiving and Merciful, and He loves the repentance of His slaves. He commands them to repent so that He might forgive them. But the devils among mankind and the jinn want to turn people away from the truth and make them incline towards falsehood, as Allah says (interpretation of the meaning): 
“Allah wishes to accept your repentance, but those who follow their lusts, wish that you (believers) should deviate tremendously away (from the Right Path) [al-Nisa 4:27] 
The mercy of Allah embraces everything
The mercy of Allah encompasses all things. If a person’s sins are very great and he has wronged himself very much, but he then repents, Allah will accept his repentance and will forgive his sins no matter how great they are. Allah says (interpretation of the meaning): 
“Say: O ‘Ibadi (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allah, verily, Allah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful” [al-Zumar 39:53] 
The Prophet (peace and blessings of Allah be upon him) said: “Our Lord comes down to the lowest heaven when one-third of the night remains, and says, ‘Who will call upon Me so that I may answer him? Who will ask Me so that I may give to him? Who will seek My forgiveness so that I may forgive him?’” (Narrated by Muslim, no. 758) 
Man is weak. If a person sins then he has to repent and seek forgiveness every time. Allah is Forgiving and Merciful, and He is the One Who says (interpretation of the meaning): 
“And whoever does evil or wrongs himself but afterwards seeks Allah’s forgiveness, he will find Allah Oft Forgiving, Most Merciful” [al-Nisa 4:110] 
The Muslim is vulnerable to making mistakes and sins. So he has to repent and seek forgiveness repeatedly. The Prophet (peace and blessings of Allah be upon him) said: “By Allah, I seek the forgiveness of Allah and I turn to Him in repentance more than seventy times each day.” (Narrated by al-Bukhari, no. 6307) 
Allah loves the repentance of His slaves, and accepts it. Indeed, He rejoices over it, as the Prophet (peace and blessings of Allah be upon him) said: “When a person repents, Allah rejoices more than one of you who found his camel after he lost it in the desert.” (Agreed upon. Narrated by al-Bukhari, no. 6309)