What is the best posture while typing?

Posture. The best posture is sitting upright with your back straight. Avoid slouching or leaning forward. Try not to rest your hands or forearms on any solid surface. Take frequent breaks and try to avoid being in one position for a prolonged period of time.
Also. ... Eyes looking straight ahead at the screen [head not tilted up/down]. Elbows bent at 90 degrees. Wrists straight. Take breaks every 30 minutes and vary your tasks. Agree with dr. P. Good luck with keeping your body happy in our digital age. [for more info and pix, see comment].
Relaxed. Do a paradigm shift. Think about yourself like an athlete i.E take care of your body. So warm up, stretch out, take breaks...All the guidelines are great but you need to fine tune what works for your body. And it needs to be comprehensive ie head to toe. So head and neck position, shoulders back but not too stiff, adjust seat height etc...And proper breathing. Best of luck.