In Hogwarts Legacy, locks are magical barriers on doors and chests that block access to certain areas or loot. They are marked with a lock icon and come in three difficulty levels: I, II, and III.
To open locks, you must learn the spell Alohomora, which is unlocked during the quest The Caretaker's Lunar Lament. Higher-level locks require upgrading the spell by collecting Demiguise Moons.
Unlocking locks gives access to hidden rooms, chests, Field Guide Pages, and quest areas. They are used to gate progression, encourage exploration, and are important for map completion.