It's extremely basic stuff, and it won't apply to many people, but the first step in figuring out what is wrong with a car key remote is to verify that the problem is the remote. So if you have a second remote, and you haven’t already done so, you’ll want to check whether or not it works.
If the backup remote can lock and unlock your doors, then you’ll know for sure that there’s a problem with your main remote.
If your backup remote doesn’t work either, it’s always possible that it is also bad. However, there could also be a mechanical or electrical problem with the door locks.
At this point, you'll want to check and make sure that your physical key, or emergency valet key, can work the locks.
Tip: If you don't have a spare remote, you may be able to buy a used one or get one from your local dealership. Your local dealership may also have a universal remote to check if your remote lock mechanism works.