I drink lots of water but still get dehydrated how can I fix that?

I drink a lot of coffee and I’m always running around doing things but I also drink a lot of water. But lately I keep getting dehydrated and having to get hospitalized because of it. Any suggestions on what’s wrong with me or what I need to do. and is there any at home remedies that might be able to subdue the stomach pain if it happened again because I just can’t afford to go to the hospital again. thank you! and I hope you can help