No, you do not have to wear the seatbelt in order for the airbag to work, as airbags and seat belts operate independently. When a collision occurs, seat belts distribute the energy created by the impact around the body in order to protect it from severe impact. Airbags assist in the protection of a car’s occupants, independently of seat belts.
Airbags are meant to assist the seat belt in protecting the occupants of a vehicle, but there is no direct connection between them, as they operate independently. When a collision occurs, the car stops very quickly. If you are not wearing a safety belt, you will continue to move forward at the vehicle's original speed until the car's steering wheel, instrument panel or windshield stops your movement. Safety belts distribute the energy created by the impact across an occupant's body and allow for a more gradual stop, keeping occupants wearing safety belts safely restrained.
However, in very severe crashes, even occupants that wear a seat belt may come in contact with the car's interior. Every car-maker strongly recommends wearing seat belts at all times, as they are the main defense against personal injury during a crash.