When winter comes freezing weather can cause problems with locks. Moisture in the air can freeze inside locks making them hard to close and open. Dealing with frozen locks can be quite frustrating but there are well known and simple techniques to over come it.
Heat the Key
Sometimes when dealing with a frozen lock using a heated key can be the easiest and most effective solution. You have a couple of options to warm up a key, either by using your body heat or a lighter. You can warm the key with your hands by rubbing them against each while holding the key and when the key is warm enough insert the key into the lock and remove it few times until you can turn the key inside the lock. If you have a lighter heat the key from a reasonable distance and then try to turn it inside the lock.

Use Hand Sanitizer
Hand sanitizer has become very common as a result of the corona pandemic. The alcohol content in the hand sanitizer can help to dissolve the ice your frozen lock. All you have to do is apply the sanitizer gel to the key before inserting it into the lock or alternatively if it is a sanitizer spray then just spray directly into the keyhole and try to turn the key.
Use A Steam Towel
Pour some hot water on a towel, wring it out and place it on the lock to melt the ice. Repeat this operation couple of times until the ice melts.

De-Icer
These commercial products often contain alcohol and other substances that can quickly melt the ice within a lock.
Lock Lubricant
Before winter breach out in his full power spray some special oil called graphite in your locks. It stops water from getting in and freezing, you can also use WD-40 spray to keep it from freezing and make it smoother.