For serious lock problems it is usually best to call a locksmith or to replace the lock.
How does door lock works.
The key to match the particular lock lifts the pins to the correct height to allow the latch the part that protrudes into the door frame to be pulled back against the spring allowing the door to open.
Doors with a twisted tab lock are still easy to get past even if that tab is set to lock these locks appear on the handle of a door when either facing laterally or vertically the door will be locked or unlocked.
The lock is set from inside the door.
The lock mechanism may not work simply because the lock is dirty or dry and needs to be lubricated with graphite do not use any type of oil because this will gum up the works.
The cam then releases a spring which shoots the tang forward securing the door to the wall.
The key turns the cylinder which in turn turns something called a cam.
A key is necessary to release the tang.
If the door lock relay needs to be replaced it can be indicative of an underlying concern with the power door locks.
How door locks work.