From the perspective of a cyclist, what is a common way to hydrate throughout the day? A couple of nights ago, I went for a ride. My destination was only about 4 miles away from my house, and it was a downhill journey. Of course, I had to ride back up many hills to get back home, and didn't stay at my destination very long. The total journey was 8 miles. My bicycle is also a single-speed bicycle, so I didn't don't have the luxury of gears which resulted in a challenging ride.
Anyway, I woke up with a headache and nausea the next morning; this was about a week ago. According to the posts I've have read regarding headaches after cycling, I've come to the conclusion that I must be severely dehydrated because I'm still feeling the symptoms today, just not as much.
I'm just not very disciplined when it comes to sufficiently fuelling my body. I really want to take steps to prevent this kind of issue from happening again. I used to drink 4 litres of a water per day, but the regular trips toilet gave me the impression I was overdoing things when trying to consume 4L in a couple of hours, and so, I got into the habit of drinking when I felt like it which resulted in me drinking much less than 2L per day.
I'd really appreciate some input. Drinking water should be a straight-forward process, but regularly taking small sips like many people have suggested has never worked for me; I end up not drinking as much as I should for my weight of 175lbs/12.5 stone.
I should add that I'm probably in a calorie deficit due to eating 2 small meals per day rather than my usual 3-4 medium to large meals per day. I experienced this issue in the past (many years ago) after weight training (squats and dead lifts) on an empty stomach. A bottle of Lucozade and lying down for a couple of minutes fixed the issue. However, I'm sure many other factors were at play e.g. breathing technique and so one because I trained on an empty stomach years after that and it never happened again.
If the issue has nothing to do with dehydration, then it could be something to do with me not eating enough.
Main question:

What is a common way to hydrate throughout the day at home, but also prior to/after a ride?

I have some additional questions:

After becoming dehydrated, would it be best to rehydrate with water, or use some special kind of energy drink?

Does repeated trips to the toilet when I consume water throughout the day mean I'm hydrating myself incorrectly? I definitely don't have a weak bladder.

Should I be including the water I use in food, i.e. oats, as part of my daily water intake measure, or should I only be measuring water I drink directly?



EDIT

This was in London
I consume very little salt. For example, breakfast consists of oats (made with water), crushed almonds, and fruit. The second meal I've been having is eggs, yams or potatoes and various vegetables. Very bland indeed, and definitely lacking salt from what I can see.
I've been riding regularly since December 2019, and prior to this, although I drive, I used to ride a lot. This is my first single-speed/fixed gear bike though. All of my previous bikes had gears, and riding up hills was easy, however, it's a totally different experience with a single-speed bike. It's much more work, especially with my gear ratio.
At the start of 2020 I was about 187lbs/13.5 stone, but the change of diet and reduced weight training caused me to lose a lot of weight. I wouldn't say my diet is a ketogenic diet though, but I'm starting to believe undereating was the cause of it. I had 4 meals yesterday, a lot of water, fruit and a glass of juice and the nausea and headache have gone. Looks like I really need to pay close attention to my diet.
I've been lifting weights a long time and I'd say I'm quite fit. Even when I take time off training, it doesn't take me long to get back in shape, and although the ride up the hills was challenging because I didn't really pace myself, I wasn't knocked out. I recovered quite fast, but the headache and nausea the next day concerned me.
Very unlikely you were dehydrated from such a short ride. If you were dehydrated post ride, you almost certainly started out dehydrated.  Humans evolved to the top of the food chain by drinking when thirsty, the advent of the '8 glasses a day, drink all the time' has been popularized in my lifetime (First references appear to be a 1945 FDA recommendation), is controversial and largely debunked.
Worth a read.. but this is just one of thousands saying the same thing .
(https://www.med.umich.edu/1libr/Gyn/ObgynClinic/8GlassesWaterMyth.pdf)
What I believe has happened is some people have lost the ability to listen to their body and know when its time to drink, and are so used to drinking a measure amount to a clock they now mistake the sensation of thirst for dehydration.
So how much to drink....
Drink when you are thirsty.  Use the color of your urine to tell you if you are drinking too much or too little.  Personally, if I am about to head out on a long event then I preloading a day or two before - Buts thats mostly because I tend to not drink enough, so the conscious effort is need to ensure I do not start out thirsty.
With all that out the way, say you really were dehydrated, not just hungover (which is mostly dehydrated with toxic by products of metabolized alcohol), had Covid19 or one of many other medical conditions that cause headaches, what to do...
Rehydrate with water if its mild. If you want to rehydrate quicker, or it is moderate, rehydrate with an isotonic drink. Do NOT consume energy drinks, they use more water than they provide.  Drink until you pee, then drink another litre is a reasonable point. You are recovered when your pee returns to normal color.
If the dehydration is severe, then you need medical intervention, likely a saline drip (Speaking from experience, magic, but like any medical procedure, negative side effects are always a possibility so should be avoided whenever possible)