There are two ways to insulate an attic and the difference matters. A vented attic is insulated at the ceiling plane, keeping the attic itself cold and outside the conditioned envelope. An unvented or conditioned attic is insulated at the roof deck instead, bringing the attic space inside the envelope. Both work, and both fail badly if the details are wrong.
In a vented attic, air sealing the ceiling plane comes before adding depth, because insulation slows conduction but does nothing about the air moving straight through a recessed light housing or a plumbing chase. In a conditioned attic, closed cell spray foam on the underside of the roof deck handles the thermal and vapor control together, which is the approach we use for vaulted ceilings and for attics that contain HVAC equipment.