Extreme heat by historical standards is in the news, and most likely in our future. So this question is how to know when you are on the verge of being seriously affected by the heat, and what to do about it.
This is not a question about how to avoid adverse effects from heat, although avoidance is the best policy. That must have been answered elsewhere on TGO, and includes e.g., getting well hydrated before the trip, staying hydrated during the trip, resting in the shade (if any) as necessary, putting a wet cloth on your head and around your neck, stuffing your cap with snow (if available) and hiking in the early morning and napping during the heat of the day.
The question assumes that you have not been sensible, although you know better, and a drink and a short rest are no longer enough to restore you. What are the first warning signs of imminent danger, and what should you do?
Assume that you are on a long hike or a backpackpacking trip, and are hours from the trailhead. Walking out to airconditioning and IV fluids is not an option. You have a PLB, but rescue will take many hours. Assume two scenarios: (1) plentiful water that is nearby and potable; (2) Scarce water -- i.e., you your companions (which number only several) have several quarts apiece left. You were expecting to resupply in several hours.