It might just be me, but I couldn't for the life of me figure out how to trade with a friend over the internet.
How do you trade in Pokemon Sun Moon? Is it as convoluted as I think it is?
Go to Festival Plaza in Sun/Moon
You will need to go through a short tutorial if you haven't opened it before
Festival Plaza will be enabled once you reach the first Pokémon Center in the game. If you don't see it, continue the story.
Connect Sun/Moon to the internet
Ignore this. You are not connected to the internet at large and thus cannot trade with your online friend just yet.
If you want to interact with them more in the future, it is recommended you add them to your 'VIP List' to make them easier to find in the future. You can do this after the trade by going inside the castle and talking to your friend's character standing near one of the tables.