For my fellow Catholic Christians, I remembered one tip from my spiritual director on how to resist urges, and I want to share it to you. The tip is to do the following when you feel urges:
Visualize Jesus Christ crucified on the cross looking at you, let that image linger and ask Him to help you in your struggles and offer to unite your struggles with His suffering; or
Visualize the beautiful face of our Blessed Mother, looking at you with her motherly gaze, let the image linger and try to ask her to help you to regain your chastity and walk towards Jesus.
I hope that they may be of help to you. God bless us all.