Passive Attic Ventilation
Attics can get so hot in the summer that you have trouble breathing there, and if yours is one of them, you need to do what people who live in hot climates do: Increase air circulation. This air circulation is also important in the winter, because without it, condensation settles on the framing and insulation, promoting the growth of mold and fungus that rots wood. A typical passive ventilation system consists of intake vents located near the floor and exhaust vents in the roof or gables. Cool air heats up inside the attic and rises, and the motion creates a natural convection current.
Cooling a Warm Attic
If your attic already has vents, but it's too warm, you may be able to cool things down by increasing the venting area. The total area occupied by vent grids shouldn't equal more than 1/150 of the total floor area of the attic, though, assuming the area is equally divided between intake and exhaust vents. Excessive or imbalanced venting fails to create a strong convection current. The best place for intake vents is in the soffits, which are the parts of the roof that overhang the walls, and the best place for exhaust vents is in the roof ridge.
Sealing Gaps and Insulating
It's important to keep the house warm in winter, and to do that, you should separate the attic from the rest of the house with a layer of fiberglass or cellulose insulation. If the ceiling has gaps through which air can pass, though, the insulation won't do much good. The most likely places to find gaps are in the corners, where wall plates join the rafters, and around recessed lighting fixtures. Use caulk, combined with backer rod if necessary, to seal gaps less than about an inch in width and polyurethane foam to seal larger ones. Spread insulation to the tops of the ceiling joists once the gaps are sealed.
Using the Attic as a Living Space
If you're creating a living space in the attic, you need to insulate the walls and ceiling just as you do in the rest of the house. The best way to do this and still allow adequate venting to protect the roof is to install knee walls and a drop ceiling. You can insulate these to provide a warm environment for yourself while allowing air to circulate behind them. The HVAC ducts should be inside the envelope you create to minimize heat loss. Consider having a professional assessment of your heating and cooling system to determine whether it can handle the extra square footage of the attic. If it can't, consider using electric heaters and air conditioners, or upgrading to a more efficient furnace and higher Seasonal Energy Efficiency Ratio central air conditioner when your system reaches the end of its useful life.