Drill into the corners of the wood bed frame with a drill bit that matches the size of your lag screws. If you have a metal bed frame, you can wrap the chain or rope ends around the corners of the frame to secure it. Otherwise, secure the ends of the rope or chain to the lag screws.
Locate rafters or beams on the ceiling to wrap the remaining ends of the chain around. If there aren't any, use your stud finder to locate studs in the ceilings. Mark the studs and screw lag screws into the ceiling where you would like to hang the bed.
Hang the loft bed from the beams or the lag screws in the ceiling. Be sure to choose lengths of chain that will hang low enough from the ceiling so you can access the bed.