This is a fairly broad question, because there are so many different types and brands available. I would suggest picking up some How To books, like the "for dummies" series.
First off you need to make sure the rafter is load bearing or that it cant support the additional weight of the vent and a frame. you need to measure the vent and cut a whole in the material that the vent will be passing through. then build a frame and mount the vent flush.