A hair transplant is a minimally invasive surgery and doesn't require much preparation and aftercare. But, you can follow these steps to prevent any infection or ease pain:
Wash your hair a few days after the surgery using a mild shampoo.
Refrain from combing over the new grafts for a few weeks.
Avoid wearing hats or pullover shirts to avoid damaging the grafts.