How do I stop assuming that someone is male?
Is your academic field male-dominated? I imagine that this is what might encourage you to make these assumptions, if you do not make them in other areas of your life.

For me the main thing was to try to systematically use gender-neutral pronouns, in writing and in speech. Training yourself to do this forces you to confront your bias, and eventually this should become a habit. You will also notice such assumptions made by other people, especially in papers.

This being said, if you are aware of the problem and of these assumptions, you are probably already halfway there. :)