How do you get a pet unicorn?

Solution 1:

I'm going to assume you're talking about the Unicorn Mount. This information is readily available on the Terraria wiki, which I have linked to below.

In order to get the Unicorn mount in Terraria, you must acquire the Blessed Apple mount item from any enemy which exists in the Hallow, which appears once you have entered Hardmode. The Blessed Apple has a 0.5% chance to drop, increased to 0.67% in Expert Mode.

This enemy and item only exist in the desktop version of Terraria.