To find them, you'd need to:
1. Remove the interior door panel: This involves unscrewing screws and carefully prying the panel away from the door. There are numerous online resources and videos showing how to do this for a 1997 F-150. (Search "1997 Ford F-150 door panel removal").
2. Locate the latch mechanism: Once the panel is off, you'll see the door latch mechanism. The switch is usually a small, plunger-type switch connected to the latch.
There may also be a switch in the tailgate, following the same principles.
Keep in mind that diagnosing a faulty "door ajar" light might require checking the wiring harness as well, as a broken wire could be the problem rather than the switch itself.