Electrolytes and fluids are the way. I ran the Camino de Santiago with these electrolytes from Amazon (non-caffeine).
I’ll take 1 before running and an additional tablet about every 1-2 hours while continuing to sip water.
https://www.amazon.com/Electrolyte-Rehydration-Replacement-Hydration-Minerals/dp/B01N1P1ODD/ref=mp_s_a_1_30?crid=3ODEMZZQJIBU5&keywords=electrolyte+tablets&qid=1686772797&sprefix=electrolyte+%2Caps%2C206&sr=8-30