Step 1: Check Your Internet Connection
Be sure that your system in the Nintendo 3DS family is connected to the Internet. If you are connected properly, “Internet” will be displayed in the top-left corner of the upper screen of your HOME Menu.
Step 2: Create a Game Sync ID in Your Game
Once you’re connected to the Internet, launch your game to generate a Game Sync ID. To do so, you’ll need to have played your Pokémon Ultra Sun or Pokémon Ultra Moon game to the point where you visit your first Pokémon Center.
• After you’ve reached that point, press the X Button and then select Festival Plaza.
• Enter the castle located in the middle of Festival Plaza.
• Examine the PC (it’s on your right) and then select Game Sync.
• Select Yes to connect to the Internet. Your game will be saved and you’ll connect to the Internet.
• After a brief explanation of Game Sync, select Create your Game Sync ID.
• After you select Yes, wait briefly until your Game Sync ID appears at the top of the screen.
• Write your Game Sync ID down so you can use it on the Pokémon Global Link website.
Step 3: Register Your Game Sync ID in the PGL
To register your game at the Pokémon Global Link, you’ll need your Game Sync ID and a Pokémon Trainer Club account. You can register for a Pokémon Trainer Club account on the PGL website. Players under age 13 will need help from a parent or guardian.
If you’d like to add another game to your Pokémon Global Link account (for example, if you have registered Pokémon Ultra Sun and would like to register Pokémon Ultra Moon as well), select Account Settings from the Pokémon Global Link home page, and then select Register additional game. Or you can log in again, and at the bottom of the screen, select the icon labeled Register additional game.
Step 4: Use Game Sync
Now that your game is registered, use Game Sync to connect your game so you can connect to the Pokémon Global Link for Online Competitions, Rating Battles, and more. To use Game Sync manually, enter the castle located in the middle of Festival Plaza and then examine the PC. Select Game Sync to manually start the process. Note that you may need to wait a little while after your previous Game Sync before you can use Game Sync again. If you try too soon, you’ll receive an error message.
Now you’re ready to have fun playing on the Pokémon Global Link with your registered Pokémon Ultra Sun or Pokémon Ultra Moon game. Good luck, Trainers!
Source: Pokémon Global Link