1. Diagnose the Problem:
* Key won't turn: This could be due to a broken key, a jammed lock cylinder, worn lock tumblers, or a problem with the door latch mechanism.
* Lock actuator doesn't work (power locks): The problem might be with the actuator motor itself, the wiring to the actuator, the door lock switch, or a blown fuse/relay.
* Door won't latch: This could be a problem with the latch mechanism, the striker plate (the part on the door frame the latch engages with), or even binding in the door itself.
* Unlocking but not locking: Similar to above, but focused on the locking mechanism.
2. Troubleshooting and Repair Options:
* Lubrication: Often, a squirt of graphite-based lubricant (like dry graphite spray) into the keyhole can free up a sticky lock. Avoid WD-40, as it attracts dirt and can gum up the mechanism.
* Check the Key: Make sure your key is in good condition and not bent or worn. Try another key if possible.
* Examine the Actuator (Power Locks): If the power locks aren't working, listen for the actuator motor whirring. No sound suggests a motor failure. You might be able to access the actuator by removing the interior door panel (requires careful removal to avoid breaking plastic clips). Replacing an actuator is usually relatively straightforward.
* Check Wiring (Power Locks): If the actuator motor seems fine, check the wiring for breaks, corrosion, or loose connections. A multimeter can help diagnose electrical problems.
* Inspect the Latch Mechanism: Removing the interior door panel allows access to the latch mechanism. Look for broken parts, binding, or obstructions. Sometimes, a simple adjustment or cleaning is all that's needed.
* Replace the Lock Cylinder: If the key won't turn smoothly, the lock cylinder itself might be worn or broken. This is more involved, requiring you to remove the interior door panel and carefully replace the cylinder. You'll need to get the cylinder rekeyed or get a new one matched to your existing keys. A locksmith can do this or you can purchase pre-keyed cylinders from an auto parts store.
* Replace the Entire Lock Assembly: In severe cases, you might need to replace the entire door lock assembly. This is the most extensive repair.
* Striker Plate Adjustment/Replacement: If the door won't latch properly, check if the striker plate on the door frame is aligned correctly. It might be bent or loose.
3. Resources:
* Repair Manuals: A Haynes or Chilton repair manual for your 1998 Ford XLT truck will provide detailed instructions and diagrams.
* Online Forums: Search online forums like FordTruck.com or similar forums for advice specific to your truck's year and model.
* YouTube Videos: YouTube has numerous videos showing door lock repairs on similar vehicles. Search for "1998 Ford F-150 door lock repair" or similar.
* Auto Parts Stores: Auto parts stores can provide parts and advice.
Important Note: Working on car locks can be tricky. If you're not comfortable with automotive repairs, it's best to take your truck to a qualified mechanic or locksmith. Improper repair can damage your door, and trying to force a lock could make things worse.