I have had heartburn for more years that I want to think about. I had it for years before I was pregnant and worse while pregnant. Everyone is different, but I will give you some tips that helped me.
Avoid acidic foods - anything fried
fruit (oranges, apples, grapes, grapefruit, strawberries)
veggies (peppers including bell peppers, tomato anything raw or cooked, onions, garlic)
beverages - most fruit and veggie drinks, anything carbonated, wine
Meats (fatty meats)
I found that eating about 3 hours before bed, a short walk after dinner and sometimes a cup of yogurt or pudding would help. The yogurt or pudding would cling to the sides of my throat and help calm it down. I also slept in the recliner many nights. When I did sleep in my bed, I found that sleeping on my left side did make a difference.
Good luck.