The switch in the door jamb tells the car when the door is open. This switch can get mashed if the seatbelt doesn't fully retract before you shut the door. These switches also corrode if you live in an area that uses salt.
Try fiddling and wiggling the switch and see if you can recreate the problems. If the switch doesn't move smoothly replace it.
Try fiddling and wiggling the switch and see if you can recreate the problems. If the switch doesn't move smoothly replace it.