Car remotes can stop working for several reasons. First thing to check is the battery. These can almost always be easily DIY replaced by popping the back off and swapping the battery out. Some vehicles (particularly BMW/Land Rover) can have a rechargable battery soldered to the circuit board. Like all rechargeables they have a limited lifespan. It
If the remote works will only lock or unlock it’s probable that one of the buttons is damaged or has become detached. Replacing faulty or missing buttons can normally be achieved by anybody who can use a soldering iron. Old perished rubber centre buttons can be upgraded with ceramic buttons.
Even if your remote is working – check that your key actually works in the lock. Often remotes go flat but customers can’t open the car because the locks have been changed or are faulty.