Thinning hair or the odd hair lost is not the same as baldness, which is normally caused by your genes and hormones. In some cases there are also environmental factors contributing to early massive loss of hair. There is very little or nothing you can do to prevent getting bald.
You can try, however to slow down the process by changing your hair care routine. Use a shampoo which is mild leaving the hair thicker and stronger. The shampoo should contain herbal extracts to stimulate circulation and growth. Some of the herbal extracts and essential oils are really producing great results, unfortunately they can not do miracles.