Learn your triggers - tomato, cola, pineapple - really, anything acidy are bad at this. Eat small meals frequently instead of big meals less often. Speak to your phamacist and work out which flavour of gaviscon / mylanta you like. And don't eat too close to bedtime!

Good luck - I'm usually awake until 3am cause of heartburn