Your ob should be able to prescribe you a short anti acid for your heartburn. I had to take a high dose to help with mine. Also for hydration try the liquid IV drink mixes they do wonders. As far as sleeping try Tylenol pm since you need the Tylenol it has Benadryl in it and it might help you get some rest.
Not related to your symptoms but it may help get you in a more restful mood to sleep: magnesium lotion. I use it for restless leg syndrome so I rub it on my hips and thighs. Some people put it on their feet or wherever. I got mine from 8 Sheep Organics. There are also power magnesium supplement drink like Natural Calm that might help. Definitely try to get some electrolytes in you: bone broth, liquid IV, watermelon.
I was in latent labour with my second for weeks, maybe even a month. It was exhausting. I sadly don’t have much advice. Depending on far along you are, you could try labour inducing methods? Although, they didn’t work for me and just brung on my contractions. Ended up being induced in the end 🙄