Replace the hinges or attempt to bend them back by wedging a piece of wood under the door for a weekend. Replacing the hinges is your best bet.
The door lock, on your 1999 Mercury cougar, can be replaced by removing the inside door panel. The locking mechanism is easily visible and can be changed.
get a hinge replacement kit for that door. its the door sagging NT the latch.
by licking stuff
You didn't explain much of what was wrong, but with my cougar I thought it was the latch, but it was actually having to replace the bushings in the door hinge. It used to be that you could just by the bushings kit, but now you have to by the whole set up.
Check to see if the door is just a little bit lower than the door frame pin. If its lower then check the hinges for tightness. If they are tight but worn then the hinges need to be replaced to get the door to align.
Check and fix the engine.
clean out the MAF sensor with some alcohol
Chain and it is a very (~1000.00) costly fix.
There is no way to fix a catalytic converter for a 1987 Mercury Cougar, since it is a sealed and unrepairable item. Once it goes bad, you must jack up the car, unbolt the old converter, then put a new one in its place and bolt it in.
Remove the inside door panel of your 1999 Mercury cougar. The entire window mechanism will be visible. Remove the wiring harness from the window motor. Remove the window motor linkage. Remove the window motor retaining bolts. Reverse the process to install your new window motor.
spray your door latches with wd40.
Follow the troubleshooting tree that is associated with that code.