Mark the outline of the gable vent centered on the inside of the gable wall. Drill through the four corners of the outline. Connect the four corners with lines on the outside of the wall and cut the opening with a circular saw, set deep enough to cut through siding and sheathing.
Knock the cut piece from the opening. Cut two pieces of 2-by-4 lumber to fit horizontally between the nearest studs on either side of the opening. Nail them in place aligned with the top and bottom edges of the opening. Cut two pieces to fit vertically between the horizontals you just installed and nail them in place aligned with the side edges of the opening.
Fit the vent grill into the opening from the outside. Drive 1 1/4-inch treated deck screws through the sleeve of the vent, inside the 2-by-4 frame you created, into the frame. Use two screws on each side of the vent.
Remove the ridge shingles from the ridge the vent is to be installed on. Use a chalk line to mark a line across the roof, 3 inches below the peak on either side. Cut through the roof decking with the circular saw. Pry the pieces out with a pry bar. Hammer any protruding nails flush with a hammer.
Position the ridge vent on top of your peak, aligned to overhang evenly on each side. Fold the shingles down along the edges of the vent and slip the edge of the metal tab underneath. Nail the vent in place with 1-inch roofing nails, one every 8 to 10 inches. Drive the nails through the shingles.
Install shingles to the cap of the ridge vent according to the manufacturer's instructions, if called for. In general, choose matching shingles. Start from each end, overlapping the shingles toward the center. Nail on the edge that will be overlapped so that the nails are hidden.