You must know this is a sin and he must fight these waswas from the shaytan. Avoiding mixing with females and transfer to a segregated school if possible. If this is not possible, lower your gaze.
Please also read the following:
Please also read the following: