Disclaimer: This applies to many cars and trucks that have wiring inside doors and lift gates manufacturers (read assemblers) run wiring through the hinge side of the jamb into and through the door to provide niceties such as power windows, locks, mirrors, blind spot monitoring, electric latches, and every other vestige of technical prowess an engineer can cram into it. It will not apply to all doors and with newer vehicles, it would be best to consult a competent mechanic or dealer service department to perform this fix.
DANGER!!! Airbags are sometimes located inside the door as well. If this is the case, ABSOLUTELY DO NOT ATTEMPT THIS FIX. Take it to a mechanic. You could be severely injured or killed. Doors will be marked with 'airbag' 'SRS' or other nomenclature (names). These are also marked with bright yellow wiring and connectors, but any voltage, including static electricity may set these off.
WARNING!!! accessories in many if not all later model cars (built after 1996) are computer control are multiplexed. This means that wires serve to communicate as well as to transfer voltage and perform more than one function for one given wire. A wiring diagram, as well as a grounding strap would be a good idea for this fix if you attempt it.
This article is not a substitute for troubleshooting and diagnostics, perform this and all other fixes at your own risk.
I've seen this in cars and appliances where manufacturers are proving minimal slack at stress points in wiring and using thinner wire. When a door, hatch or lift gate is opened and closed thousands of times, the wiring connecting the door to the body shell can and will break. The result is that your windows, locks and other accessories will not work correctly. Since latches are usually on the lift gates of most modern vehicles, it also means these won't work with a remote.
What you need to do is test if there is voltage or a signal going to the accessory when you operate it. if not, test it at the source inside the vehicle, usually at the body control module or connector inside. You can also attempt to test for continuity from the connector to the part that isn't working with an ohmmeter. an infinity reading means the wire is broken. This will mean removing lots of interior parts. It would be a good idea to have a service manual on your vehicle.
Okay, so you've determined the wiring is broken. The best bet is to remove the affected wiring harness and replace it with a new one. This means taking a lot of bits apart to get access to it. Another fix that I do is to disconnect the battery, and any connectors to get enough slack in the wiring. Carefully removing any boot or covering. Then you can splice the damage wire using butt connectors (not the best plan as these can pull out) or by soldering and heat shrink tubing (which is best). It would be a good idea to add a bridge of wire to give this more slack as the repaired section will be shorter and more prone to breakage. Heat shrink tubing will be a good idea to make sure these connections don't short out against the frame or other wires. Test the circuit, but the vehicle back together and you're done. Maranatha!