If you have heartburn at night, sleep on your left side, not on your right side or back.This reduces the backup of food and acid into the esophagus that causes the burning sensation.
Raising the headboard four to six inches can also help.
Another good option is a special bed wedge for acid reflux, which elevates your upper body. (In contrast, using large pillows to raise just your head is not effective and may even worsen matters.) Don’t eat within three hours of bedtime.