Do you mean a remote key unlocking? If you put the key in and it locks and unlocks both sides electrically then try a spare key fob in case the buttons or battery are weak.
If it wont work mechanically with the key in the lock then first check that the door is shutting fully.
There can be other reasons , but check that first.