Take a break. Go over to the boards and stay there until you feel like going again.
But it's also important to remember that skating is a very athletic activity, and you need muscle strength and aerobic strength to do it well. So a lot of things in skating are going to make your muscles ache and make you breathe really hard. The best way to build your strength is to keep going when you feel like that, and only rest when you feel like you can't do anything more.