Start with visible problems
Food debris, a displaced rack, a damaged gasket or a loose hinge can prevent a door from sitting evenly. With the oven cool and powered off, inspect the obvious contact points without forcing the door.
When the hinge or latch is involved
A door that sags, binds, will not stay closed, or will not unlock after a cycle may need hinge, latch or alignment service. Avoid using high-temperature cleaning cycles when the door is not closing correctly.
Safety note: Appliance symptoms can have more than one cause. Disconnect power before inspecting electrical components. Do not perform gas-line work or bypass safety devices.