A headrest is something which supports the head. It is usually a suitably shaped part of the back of a chair or of a front seat in a car.
It is designed to support passenger's shoulder part and neck to prevent whiplash in cases of crash at the rear.