Any good treatments for baldness?

It’s not male pattern baldness, it’s because I’ve totally screwed up my hair with lack of nutrients and general not caring for it in the slightest. I’ve still got hair left but it’s much much thinner than it used to be.

Are there any products (that actually work!) on the market to prevent the rest of it falling out? By replenishing the proteins or similar?

Thanks!