Don’t self treat and worsen the condition please.
Going for a walk after dinner helps move the intestines, which is good to help empty the stomach. So try putting on your walking shoes and see if you sleep better, too.
If a bland diet does not help enough, or on particularly bad days, you can use something like ranitidine to stop stomach cells from producing more acid. TUMS also works on changing the pH in your stomach.
The best thing is to reexamine what you ate for dinner, and avoid foods that may have triggered acid.
Other contributors to heartburn include having a large waistline, because when you lie down, gravity pushes the stomach onto the diaphragm or breathing muscle, emptying it upward to the esophagus. Keep some handy by your bedside and hope this helps.