We have learned at the end of the Tractate Talmud Yuma – there are three types of Atonement (Divine forgiveness over sins) but with each one must do to Teshuvah / Repentance.
If one transgress a Commandment then as soon as they repent God forgives them.
If one transgresses a Prohibition then Teshuva keeps it at bay, and on Yom Kippur the atonement comes.
(Now this does not mean that a commandment is less important than a Prohibition – in fact Commandments may override prohibitions – it is only that spiritually speaking, when one fulfills a commandment of God – one draws down a Divine Light – and if the prohibition was not done or / violated, thereby in any event this light is not present. However this causes a stain on the soul above which is why the necessity for Yom Kippur to remove the stain.
For this reason one should not assume in any way that a commandment is less important than a Prohibition.
In particular the Commandment of Torah study for our sages have told us that God was ready to forgive the three cardinal sins of adultery and idolatry etc. even though the punishment is the soul is cut off and death, but he was not willing to forgive the sin of neglecting Torah study.)
Getting back to the three types of atonement, if one transgresses sins with a punishment that “the soul is cut off” or death, then Teshuva and Yom Kippur suspend the judgment and it is only through punishment / suffering that the soul is cleansed.
Until here is the teaching of our sages about the three types of atonements.
Now the Commandment of the Torah regarding Teshuva is to merely abandon the bad behavior.
This means to make a firm commitment to never again foolishly transgressed the will of God / the Great mighty King.
Of course this applies both to prohibitions and Commandments.
This is the main explanation of the word Teshuva, which means Lashiv / to return to God with all one’s heart and with all and soul, to serve Him properly, and keep all of His Commandments as the verse says “The wicked should abandon their path and the sinful person his thoughts and return to God etc.”
And in Parshas Nitzavim it says “You will return to God your Lord and listen to His voice with all your heart.”
People mistakenly assume that Teshuvah means fasting.
And even one who transgressed prohibitions that the punishment is the soul is cut off, or death – and this is not that the person themselves should cause to themselves suffering – rather God
– in other words if their repentance has been accepted that they have repented with all their heart and soul then God will as a favor remove the stain on their soul through suffering in this world as it states “He who God loves He chastise.”
This is why the Rambam and the Sma”g (codifiers of Jewish law) did not mention fasting in regards to the law of repentance, even for sins involving “The soul cut off” and death.
Rather the commandment to repent includes, apart from remorse, confession of the sin and request of pardon – as it states in the Torah, and they will confess their sins.
Now this that it states in Yoel, “Return with all your heart through fasting and crying” this was only to eliminate the negative decree which had come from God… that he punishment to wipe away the sin was going to be a plague of locust.
This is actually the reason why the public fasts, unfortunately during harsh decrees – in other words, to wipe away the decree, as it says in Megilas Esther.
Now this that it states in the Mussar books primarily the book of Roikeach and the book of Chassidim to fast many fasts, and inflict oneself if one transgresses Kares and a death from Beth Din – one who wastes semen, who is liable for death from Heaven – as it states in the Torah regarding Er and Onan and his punishment is like one who transgresses – this is only to prevent the individual from the suffering caused from above, and also to speed up the conclusion of the atonement of the Soul, in addition perhaps the person needs an extra repentance, because he is not repenting out of love but fear… – (in other words, once again, the main Teshuva is not fasting, rather it is the remorse plus confession.)