I've had ones so severe I thought my tendons were going to snap, waking me up in the middle of the night and I'm screaming and doing sympathy whines pleading for mercy. I have genuine fear of the bed time calf and/or foot cramp.
I've had a couple like that. My wife went and got some salt and told and told me to eat it. Like maybe a 1/4 teaspoon. It was a lot, but it works I swear I could feel it start to relax in less than minute.
Bend your toes toward your face. Hop put of bed and plant your toes on the ground if you have to, then lean forward, push hard. That stretch will instantly unwind the muscle.
Your brain is going to tell you that's the last thing it wants to do. Ignore it. Stretch.