It tells you at the start. Use arrow keys to turn. Use space to cast a fireball. Use f to fly on the broomstick.
Thanks to WorkingWitch111 I made "Doom on the Broom"! (In the book "Coding Games for Kids")