Yes, water certainly helps.
I don't have a problem with healing, etc., I've been doing ok in the game and having a great time.
I just want to understand the mechanics of how this works and why sometimes sleeping heals and some times it doesn't.
Sleeping does not heal. Probably what you are noticing is that you ate something before going to bed. You still get the benefits from that while sleeping.
So, drinking a Nuka Cola gives you +2 HP/s for 15 sec. If you drink, then sleep before that 15s is over, you will wake with more hitpoints than you started sleeping.
Same regards when it comes to food.
Seems pretty clear. Sleeping (by itself) does not heal a single HP in hardcoe.