Wash oily hair more frequently. How often you wash your hair should be based on how much oil your scalp produces.
If your scalp is oily, you may need to wash it as often as once a day.
If you have chemically treated hair, your hair may be drier, so you may want to wash it less frequently.
As you get older, your scalp makes less oil, so you may not need to shampoo as often. But if you see flakes in your hair, you may not be shampooing enough. This can lead to dandruff and other scalp diseases.
Information as per the AAD https://www.aad.org/public/everyday-care/hair-scalp-care/hair/healthy-hair-tips