Procter & Gamble Co. is dismantling a beauty business it aggressively built a decade ago, giving up on areas like salon products and designer perfumes that distracted from core areas and hurt its growth.

The world’s largest consumer-products company said Thursday it would carve off brands including Wella shampoos, Clairol hair dye and CoverGirl makeup and merge them with Coty Inc. in a complicated $13 billion deal.

P&G...