The best time to waterproof your attic is during construction, before the roofing is installed. Once the roofing is in place, it becomes much more difficult and expensive to install a waterproofing system.

There are a variety of roofing types that can be installed on an attic, and each has its own method of waterproofing. For example, a flat roof can be sealed with a waterproof membrane that is adhered to the roof deck. A sloped roof can be sealed with a waterproof membrane that is installed between the roof deck and the roofing material.
If you already have a roof in place, you can still install a waterproofing system, but it will be more difficult and expensive. One option is to install a waterproofing membrane on the inside of the attic, between the insulation and the roofing material. This is a more costly option, but it will provide better protection against moisture and water damage.
No matter what type of roof you have, it is important to keep it in good condition by regularly inspecting it for damage and repairing any problems as soon as they are detected.