Like all Pokemon games, there are fossilized pokemon that can be found and used to recreate said pokemon. In Pokemon Sun and Moon, this is a simple process that can be done to obtain both of the exclusive fossil pokemon.
Obtaining the Fossil
Start by heading to Konikoni City on Akala Island. There you want to head to the shop on the left hand side with a hammer, which is located across from the Pokemon Center. In the back you’ll see an older person who you need to talk to. They will offer to sell you one stone, though they mean one of each type. Each stone will ruin you 7,000, so make sure you have some cash before you do this.
Obtaining the Pokemon
To actually obtain the pokemon, you want to head north to Route 8. Upon reaching Route 8 you want to head to the right and look for a small side path on the side hand side. There you’ll find an old man who will turn your fossils into new pokemon. Pokemon Sun players will receive Carnidos and Tirtouga, where as Moon players will obtain Shieldon and Archen.