If you haven’t read about the Mythical Meloetta Pokemon, click here. To get it, simply scan the QR code provided into the QR Scanner in the game and it will allow for you to go to Hau’oli City’s Mall to collect Magearna after becoming the Champion in the game.
NOTE: You can only scan this code UNLESS you completed the main story of Pokemon Sun/Moon. This scan code can only be once per game. If you’re in the European, wait tomorrow and l will post it on here.