see also Material attachment
Practice makes perfect. Try to engage the mind in practical service and hearing and chanting about Krishna. In this way, it won't have time to contemplate the objects of the senses.
Don't purposely go places or do things that you have experience will agitate your mind sexually. And do not get despondent, as it takes time to train up the lusty mind.
Meditating on the beautiful form of Krishna, beginning with His lotus feet, helps free the mind from lust. It may seem hard to believe, but if you try it, you will see it works.