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 headed for being seriously affected by the heat, and what to do about it. To clarify, you want to notice early danger signs, and apply remedies before the person is seriously affected.
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, salt, 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 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 is not an option. You have a PLB, but rescue will take many hours. Assume two scenarios: (1a) plentiful water that is nearby and potable; (1b) plentiful water that is nearby but possibly or probably not 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.