How do I guard my mind against unhealthy sexual thoughts?

How do I guard my mind against unhealthy sexual thoughts?