You have to repent to Allah.
Keep yourself occupied. Don’t treat the act lightly. Make consequences for yourself each time you sin, for example fasting for 3 days. That way you would think twice before committing anything.
Don’t sit alone.
Ask Allah for guidance and help.