There are three main reasons your door is rattling.
Front door not locking from inside.
Quite easy to replace but if in any doubt call a locksmith.
Not for high level of security needed for exterior doors.
First you will need to work on removing the broken key pieces from within the keyway of your door lock.
And finally check the lock assembly for broken parts and double check the door lock motor.
Sticking door locks can be attributed to everything from slight settling of the house to a buildup of dust and dirt within the locking mechanism.
Privacy door knobs have a push lock or twist lock on the inside of the room.
To resolve the issue of not being open from the inside check for issues in the power locking system.
Warping if the door cannot physically lock due to the frame or door being warped an adjustment of the strike plate could rectify the problem without the need of a new lock.
This entire process is easily done with the door panel removed.
Locked and unlocked from both sides with a key inserted in a rim cylinder.
Here are the basic steps on how to fix this problem.
If you re referring to a upvc door then the chances are that the internal half of the euro cylinder has something faulty with it.
In cases of accidental locking these unlock from outside of the room using a coin or stiff push pin.
Privacy door knobs are locks for the doors in your home.
The striker fails to penetrate into the door jamb because the door or the door jamb has become warped or the screws have loosened and the plate has moved.
The strike plate is recessesd the latch bolt does not align or the strike plate needs to be reset.
It may require repair or replacement.
A rim automatic deadlatch nightlatch is fitted on the inside of your door with the key locking cylinder to insert your key to open the door located on the outside of the door.
Once the key pieces have been extracted the door lock should be examined.
These are relatively cheap to replace although i would recommend ensuring it has at least a 1 star rating and best of all a 3 star rating.
Test it with a spare key and make sure that.
Key will not work if you ve had a new spare key cut recently it could be a poorly cut key causing the problem.
Have you had a new cylinder fitted.
If a strike plate is recessed as often happens when the doorway is painted several times remove the screws pull it out and make cardboard shims to fit in the mortise.