Tauba after committing major sins, kufr, shirk etc

questions:
Assalaamu Alaikum,
How can i repent as i have committed major sins kufr, shirk .i have also make fun of islam and ask Allah to help me when i was doing haraam actions as these sins put me out of fold of islam so my question is that i must want to enter fold of islam again and ask Allah to forgive me so what steps i must take in order my repentance will be valid so that Allah will forgive me what i have done do i have to do repeat shahadah in present of some witnesses or alone also is it true that if any ond does above mentioned sins all his good deeds will be erased which he has earned even if his repentance is sincere plz explain as it has caused me mental illness

Wa Alaikum As Salaam,
If you are sure that you actually committed kufr or shirk and that you have gone out of the pale of Islam, then by doing this, all your good deeds done in Islam have been cancelled (on account of the heinous sin that you have committed). About this, the Holy Quran states, ‘And whoever denies Imaan (faith then his actions are futile (lost), and in the hereafter, he will be from the losers’ (Sura Al Maida (5) verse5)
Similarly, in Sura Al Baqara (Chapter2) verse 217, Allah says, ‘And whoever from amongst you turns away from his religion, and dies while he is an unbeliever, then their deeds will be lost in this life and in the hereafter, they will be the dwellers of the Fire. They will abide therein forever’. (2:217)
The above verse tells us that when a Muslim rejects Islam and commits kufr or shirk, then all his actions that he did while he was a Muslim will be lost and go futile. He will receive no reward for them.
If however, he reverts back to Islam (after having committed kufr or shirk), then by re-accepting Islam, he will be saved from the eternal punishment of the hereafter, and will now be treated as a Muslim having all the responsibilities of Islam applicable to him.
With respect to the good deeds he did while he was a Muslim (before leaving Islam), then according to some scholars like Imam Abu Hanifa (AR) all (the good deeds) will be lost, even in the case of Hajj, he will have to repeat it.
Some scholars however, have stated that he will get-back the former good deeds if he returns to Islam.
This is the position held by Imam Shafi (AR).
If you sincerely repent to Allah for having done the wrong things and you make amends by doing good deeds, while making a promise to Allah that you will never do those acts again, then Insha Allah, it is hoped that Allah will forgive you. You must therefore repeat the Shahadah and testify that you are a Muslim.
There is no need to say the shahadah in front of witnesses. However, it will be essential to do so, when others know that you had committed sins like Kufr and shirk. In this way, others will know that you have re-accepted Islam, and will not treat you like a non-Muslim.
Continue to beg Allah for His forgiveness and do as much good deeds as possible.
And Allah knows best,
Mufti Waseem Khan
26/05/2011