Get a duplicate copy made of the key or keys that you want to leave inside the lock box. Check the keys to make sure they work properly in the door lock.
Open the key compartment of the lock box, using your model's tumblers, push buttons or dial. The factory-set code is often all zeroes; check the owner's manual to be sure.
Find the reset pin or screw that allows you to set a new code, and activate it according to the manufacturer's directions. Set the new code and lock it in place, following the directions. Some models have a separate code for the shackle, the arched piece of metal that hangs over the door handle. You reset this code first, which automatically sets the code for the key compartment.
Close the key compartment. Try the code you set to make sure you can open the compartment door. If your model has a separate code for the shackle, test that code, too.
Open the key compartment or unlock the shackle. Lift the shackle and place it over the doorknob. Lock the shackle in place. Place the house key inside the compartment, then close the lid. Spin the tumblers or dial so your combination isn't evident.