Typically Fords have an ElectricalSwitchToFrameGround
on the bottom side of each door Lock\Latch mechanism inside the door,
controlling the DomeLamp & DoorAjarLamp.
Could first try blowing out Lock with CompressedAir followed with PenetratingOilSpray+SiliconeLubeSpray.
If that doesn't work, take door apart & Tighten\Adjust\Replace as needed.