Measure the inside length between each rafter, where it meets the top plate.
Cut the 2x4 or 2x6 block to the prescribed length as per your measurement.
Slide the block between the rafters and down onto the outside edge of the top plate.
Connect the nail gun to your compressor air line, angle your nail gun at a 60 degree downward angle and drive four to six nails along the inward facing side of the block, one inch above the base of the block -- a technique called toe nailing.
Cut more blocks to the same size, slide them between the two rafter sections progressively higher, towards the hip. Ensure they are positioned perpendicular to the rafter's upward angle and end nail them on both sides with your nail gun. Your nail will drive through the side of the rafter and into the end of the block, securing the block to the rafter.