"There are many ways to pass through locked doors in the magical world (see the Fire-Making Spell, Gouging Spell, and the Reductor Curse) where you wish to enter or depart discreetly, however, the Unlocking Charm is your best friend."

The Unlocking Charm, also known as the Thief's Friend (Alohomora) is a charm that opens mechanical locks that are not protected by magic. It is also able to open doors locked by Colloportus. There is a spell called the Anti-Alohomora Charm which is used to counteract this spell.

In the Chamber of Secrets video game for GameCube, Xbox, and PS2 it's specified that the Unlocking Charm is for use on mechanical locks. In most other sources, it's used on magical locks and the Locking Spell as well.