Various aspects like sleeping position, posture, bed, mattress, place, time, etc., decide how you'll doze. So, it is important to understand the ingredients of a good sleep. After all, you don't want to spend one-third of your life the wrong way, right?!
The healthiest position is sleeping on the left. It prevents heartburn and snoring, leads to good spine alignment, and facilitates better elimination of waste materials. Sleeping on the back is also good, but may lead to some amount of snoring.
Don't go for a very hard mattress, as it will make you uncomfortable and may lead to back pain. Very soft mattresses can lead to a bad posture. The key is to find the perfect balance. Try sleeping on the mattress before buying it. Ensure that it has a good quality memory foam, otherwise, it will heat up as the night progresses and make you hot.