Sefer HaChinuch (364) explains that the mitzvah of viduy, confession, has a number of beneficial outcomes. By verbally enunciating his misdeeds, a sinner acknowledges that he believes that Hashem is aware of his actions, good and bad. Also, by specifically recalling his transgression and expressing remorse for it, he makes it more likely that the next time the sin comes his way, he will be more careful to not transgress by doing that which is forbidden. Through this, his actions will be pleasing to his Creator.
R' Saadiah Gaon (Emunos VeDei'os 5:5) identified four components of repentance. They are: abandoning the sin; regretting the sin; requesting forgiveness for the sin; and accepting upon oneself not to repeat the sin. These are alluded to in the verses in Hoshea:
O Israel, return to the L-RD your G-d, for you have stumbled because of your iniquity; Take words with you, and return to the L-RD. Say to Him, "Take away all iniquity; receive us graciously, for we will offer the sacrifices of our lips. Assyria shall not save us, we will not ride on horses, nor will we say anymore to the work of our hands, 'You are our gods.' For in You the fatherless finds mercy." " I will heal their backsliding, I will love them freely, for My anger has turned away from him (Hosea 14:2-4).
Return, O Israel refers to abandoning the sin, while for you have stumbled in your iniquity - by virtue of realizing that sin is an obstacle - refers to regretting the sin. Take words with you alludes to requesting forgiveness, and we will no longer say 'O our gods!' to the work of our hands refers to accepting upon oneself not to repeat the sin.
R' Saadiah Gaon says that one should add three more practices to these four things - additional prayer, additional giving, and helping other people repent from sin. [These are derived from Mishlei 16:6: Through kindness and truth iniquity will be forgiven, and Tehillim 51:15: I will teach transgressors Your way.]
When a person wholeheartedly accepts upon himself not to repeat his sin, his repentance is accepted:
R' Israel Salanter writes (Ohr Israel, Letter 15): The foundation of the Days of Repentance is accepting upon oneself to abandon one's sinful ways. This is the most difficult of all toils.