You can go to the optical store where you get your sports glasses and ask them to give you some spray which can prevent your sports glasses from fogging. Then you apply the spray to your lenses before you go to play ice hockey. It will help you to some degree.
If you don't have anti-fog coating on the lenses, there is no other ways to prevent them from fogging when playing ice hockey. You should take a microfibre towel to help you remove the fog from your sports glasses when you go to play ice hockey.
If you can't stop your sports glasses from fogging when you play ice hockey. You don't have to wear sports glasses if you have good eyesight. If you have bad eyesight, you can choose to wear contacts just for hours when playing ice hockey.
You can use some anti-fog spray. The key is the air flow through your mask. You have to make sure none of your breath goes upwards so you have to direct your breathing out the front of the mask. As well, make sure your mouth is not blocked by any solid portion of your mask or a sloppy chin cup.