It takes years of practicing coding... Just kidding, Here, look at this:
void OnStart()
{
AddUseItemCallback("", "key1", "mansion_1" "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, false);
RemoveItem("key1");
}
mansion_1 is: The name of your door you want to unlock.
key1: The name of the key you want to open the door with.
So now, replace everything from the code above from mansion_1 to the door to unlock, and key1 to the name of the key to use to open the door.
Then copy it into your .hps file for your level!