There are several ways to treat dandruff, such as using medicated shampoos containing ingredients like ketoconazole, coal tar, or salicylic acid. Additionally, you can try massaging your scalp with tea tree oil or apple cider vinegar, avoiding hair styling products that can cause buildup, and eating a healthy diet that includes foods rich in zinc and omega-3 fatty acids. It's important to keep your scalp clean and moisturized to prevent the growth of fungus and bacteria that can contribute to dandruff. If your dandruff persists despite these measures, it may be helpful to consult a dermatologist for further evaluation and treatment options.