Draw a clearly visible line on the wall, between the bottoms of the joists on both sides of the loose one. Use a builder's level or similar long straightedge. The result is a line marking the desired position for the bottom of the loose joist when it is secured to the wall.
Hold a joist hanger against the wall. Use a rigid joist hanger if the situation permits the hanger to be attached to the top edge of an existing joist or rafter. Or use a jiffy hanger of it must be attached to the vertical face of the wall or an existing timber. Adjust the hanger position so that the base is level with the bottom line drawn on the wall and the joist and hanger line up with each other to form a straight line along the length of the joist.
Mark the hanger fixing holes on the wall using a pencil or similar sharp-pointed item. Check that the position is still correct before marking. Check again once the marking is complete.
Ensure that the electric drill is not connected to a live power supply. Fit a suitable size masonry bit into the chuck and tighten it using the chuck key. Connect the drill to a live power supply and gently press the trigger. If the bit isn't perfectly centered, it will spin with a wobble or eccentricity. If that happens, disconnect the power and adjust the position of the bit before trying again.
Don safety goggles. Drill a hole for each fixing point if the wall is made from masonry. Drill to the depth suitable for the type and length of screws being used. Push screw anchors into the holes. It is not necessary to drill holes into a timber structure unless the wood is extremely hard, such as old oak.
Screw the hanger into position, making sure that the screws are tight and that the hanger is securely attached to the wall.
Lift the joist up and over the joist hanger, then lower it into the base of the hanger. Finally, check that it is seated correctly in the bottom of the hanger.