It's most likely your door switch on the microwave.
The switch tells the microwave when the door is closed and it must be stuck in the position showing it's open.
You can probably replace the switch pretty easy by looking up the model number online.
But if it were mine I'd just unplug it when not needed.
Although if you feel like replacing the switch, depending on the model of your microwave the microwave door switches are priced as low as $3.00 that's a lot cheaper than a new microwave.