Complex sentence: YouTube was a very popular product but the company really struggled to make profits, especially when YouTube began having legal problems with the media company Viacom.
Split into simpler sentences: YouTube was a very popular product but the company really struggled to make profits. When YouTube began having legal problems with the media company Viacom.