I hiked up Mt. Baldy last year, but while I managed to make it to the top, I made lots of mistakes.
1. I was wearing way too many layers.
2. I had too little water. I had no liquids with electrolytes.
Wearing too many layers lead to to excessive sweating. The lack of liquids made things worse. It's honestly a miracle I even made it to the top last year.
I also had nausea and was feeling pretty dizzy which are signs of altitude sickness. I did not know if these symptoms were brought on by the altitude, or if it was just a side effect of my dehydration.
To find, out, I repeated the hike this year, with the following changes.
1. Only wear two layers. Have two more ready if I need them. Make those two extra layers light and compact, so it's not much of a burden to carry.
2. Bring more water and some gatorade.
3. Exercise more. Last year I was sick on the days leading up to the hike, so I didn't exercise. This time, I was jogging 4-5 miles 4x per week prior to the hike.
4. Bring smaller snacks. Rather than eat large things at 3-4 hour intervals, eat small snacks every ~2 hours.
I'm happy to report that with these changes all of my issues went away.