Just going to repeat + add some stuff. I am a cashier and sometimes I get strained hands from swiping items in the same direction all day long, so my hands often hurt before I even get started.
If your hand hurts, do not try to draw. It only makes the damage worse.
If the pain is very bad and won't subside with a normal amount of painkiller, try a cold pack to numb the area. You can also use a warm pack (or take a hot bath) to relax the muscles, if that helps.
If you temporarily treat the pain with medicine or numbing, don't just go back to drawing immediately. You may have stopped yourself from feeling the pain, but you could still be doing damage on your hand. You should see a doctor if this pain comes back and doesn't go away, because you probably sprained your hand.
If it is a minor problem that happens often, you can get a hand brace that is specifically to prevent carpel tunnel, and wear it when you draw or type. It tightens and reinforces to keep your from unintentionally doing bad things with your arm. It didn't work so good for me, but a lot of artists I know use it and swear by it. Worth a try.
It can also be due to bearing down too hard. This used to happen to me when I was using a tablet and monitor combo. Something about the settings caused me to bear down more than I normally would without even realizing it, and my hand would hurt like crazy after just an hour.
It's better to prevent yourself from getting to the point where your hand hurts, than try to treat it once it does. You can pay attention to the patterns you are working in up until the point it starts to hurt, and try to figure out how to stop it from happening in the first place.