can you please help me by letting me know how to refrain from a grave sin such as fornication. I know it is a greater sin but rarely I turn towards that sin.

1- Keep yourself busy so you don’t commit this sin. Don’t let yourself have any free time.

2- Repent to Allah sincerely. Realize it’s a major sin and know Allah is watching you and the Prophet (s) witnesses what you do.

3- Get married. If you cannot then at least do a temporary marriage contract.