If the Pokémon you want isn't available, place one of yours up for trade - if you either can't find it or don't have the Pokémon required for trade, then you can put one of your own up for offer in return, and wait for someone to trade with you.Enter the details of the Pokémon you want - you can filter this by Pokémon, Gender, Level, and whether or not the trainer is looking for a Mythical or Legendary Pokémon in return.
Head to the GTS and select 'Seek Pokémon' on the bottom screen when prompted. Look for the Pokémon you want - rather than waiting for someone to trade your Pokémon, if you have a specific one in mind it's always faster to search the GTS for people trading it away first, before you resort to offering up one of your own Pokémon and waiting.Follow steps 1-3 above - this time selecting the GTS option once you have done.Finish the trade - select the Pokémon you'd like to trade, make sure you're happy with the deal, and confirm it.Once you're both in the Festival Plaza and connected to the internet, they'll appear as a guest and on your Friends list as an option. Select Link Trade and choose who to trade with - if you have a specific person in mind who isn't on the random list of 50 guests, you'll need to add them as a Nintendo Friend from the 3DS' home screen first, using their Nintendo Friend Code.Select Trade - again on the bottom screen, once inside the Festival Plaza, it's the big blue button.Note that this is different to being connected to the 'local wireless communication', which you will be as standard when entering the Plaza. Select that, and then 'Yes' when asked if you want to connect to the internet. Connect to the internet - in the bottom right of the bottom screen is a wireless symbol.Head to the Festival Plaza - located on the bottom screen in-game.
With those explained, let's go through step-by-step how to take part in a trade online. You could get anything from a level 1 Rattata to a level 100 Zygarde, depending on how kind the other trainers are, and how much luck you happen to have! Upload a Pokémon you're willing to give away and you'll receive a random Pokémon someone else is giving away too.