Once you get near the point of dehydration, you're not going to re-hydrate quickly. You will need to get somewhere cool so you can rest and drink water.
Anyone working in the heat should start drinking well ahead of time to build up fluids in their body. Do eat frequently, but small meals and lighter foods. No caffeine; it increases your metabolism which is the wrong thing to do in hot weather. No energy drinks, etc. Red Bull will kill you in this heat.
Sorry for being so graphic, but monitor your urine and how often you go. You should be peeing regularly and it should stay fairly clear. If you aren't going or it's darker in color, you're headed for trouble. Also monitor your sweat. If you stop sweating, get out of the heat.
Sweating is your body's cooling mechanism. If you stop sweating, you're out of coolant.
Some Gatorade can help; but best to dilute it with water and drink lots of water only with it.
Be like the old plow horse; slow and deliberate in what you're doing.