What method minimizes pipe distrotion caused by contraction of a metal as it cools after being welded?

What method minimizes pipe distrotion caused by contraction of a metal as it cools after being welded?