You need to make sure your body is in a good place before you warm up, and that may mean scheduling your life around when you rehearse or perform. You should get a good night’s sleep, eat the right foods (there is plenty of literature on what is good to ingest or not before performing, but that’s another article entirely), and drink lots of liquid, especially tea and water.
Sometimes you won’t be able to check all of these boxes, and there will be plenty of instances when you’ve not slept quite as much as you know you should have, or maybe you had lunch too soon before you had to sing. These are okay from time to time when considering rehearsals, but if you have important live performances or even a studio session booked, pay close attention to what you’re eating and drinking, and your partying beforehand.