I also suffer from heartburn. When I finally went to the dr. a few years ago, he did an endoscopy to look at my stomach and esophagus. I have a hiatial hernia, so the top of my stomach bulges up through my diaphragm, when the esophagus comes through. This was good information to know. Sometimes I will still have heartburn no matter what I do. It is just how I am built.
I have learned what works for me, so I will share some of that here.
If I gain weight, it gets worse. If I keep my weight down, it is much better. I was able to be off of my reflux meds for over a year. About the time I entered the 2nd trimester of this pregnancy, I had to go back on them because nothing I did was helping. Increased weight (or a baby) puts pressure on my stomach and makes that hernia worse, allowing stomach acid to go up the esophagus.
My symptoms are always worse at night. I take a once-a-day pill, and I learned that I do better taking it in the afternoon, an hour or 2 before dinner, than in the morning. This way it is working at its best when I lay down at night and need it the most.
It really helps me to not eat for at least 2 hours before laying down for the night.
Certain foods bother me more than others. I just can't do coffee with caffeine these days, though a small amount of decaf with cream doesn't seem to bother me. Soda also really bothers my stomach.
Acidic and fatty foods can be bothersome, but I am more likely to make sure to take my meds than to completely avoid them forever 
Â
I don't really know if this helps, but it is my experience from the past 7 years or so. I guess a big point is that it can be really good to know what is wrong so that you can treat yourself properly.