Grate the onions and squeeze out the grate thing to get its juice.
Massage your scalp with this fresh onion juice.
Let it be there for, preferably one hour. If not, leave it there at least for 15 minutes.
Now wash off your hair with a mild shampoo and water.