After you complete the main game and become Champion, you can catch the Ultra Beasts.
UB Missions
When you start your game after becoming the Champion, go outside of your house and a guy will give you the Enigmatic Card. If you look at it in your inventory, you see that it is an invitation to go to a room in the motel on Route 8.
UB-01 Symbiont
When you go there, you find Looker and Anabel. They ask you to help catch the Ultra Beasts that are still in this world. First, Anabel asks to battle you to make sure that you are up to the task.
Pokémon Trainer Anabel has a level 61 Alakazam, a level 61 Mismagius, a level 61 Weavile, a level 61 Snorlax, and a level 61 Salamence. You get 13420 Pokédollars for winning.
Afterward, Anabel and Looker ask you to go to the secret labs in the basement of Aether Paradise and speak to Ms. Wicke.
Go to B2F of Aether Paradise and approach Ms. Wicke. After some dialogue, she gives you two Big Malasadas.
Go into the first secret lab and talk to the employee to get the DNA Splicers, the Prison Bottle, and a Soul Dew.
Go into the second lab and talk to Ms. Wicke. She gives you 10 Beast Balls.
When you go back to the motel in Route 8 and talk to Anabel, they tell you about the UB sighting. Talk to Looker to find out that the sightings were at Wela Volcano Park and Diglett's Tunnel.
Go to one of those locations. The background music will be the Ultra Beast music instead of the usual music, indicating that an Ultra Beast can be found here now. Walk around in the grass of Wela Volcano Park, or just walk around in Diglett's Cave, until you encounter Nihilego. Lower its HP as much as possible and inflict sleep or freeze, then throw a Beast Ball.
After catching it, go to Looker in the Route 8 motel and tell him you finished the mission. They'll ask you to meet them in the motel on Route 2 on Melemele Island.
UB-02 Absorption/Beauty
When you do, Nanu comes in and tells you rumors about the next UB. If you are playing Pokémon Sun, there are two Ultra Beasts in Melemele Meadow. If you are playing Pokémon Moon, there are four Ultra Beasts in Verdant Cavern. You get ten more Beast Balls.
In Pokémon Sun, go to Melemele Meadow and walk around in the flowers until you encounter Buzzwole. Lower its HP as much as possible and inflict sleep or freeze, then throw a Beast Ball. You have to catch two Buzzwole before this part of the mission will end.
In Pokémon Moon, go to Verdant Cavern and walk around until you encounter Pheromosa. Lower its HP as much as possible and inflict sleep or freeze, then throw a Beast Ball. You have to catch four Pheromosa before this part of the mission will end.
UB-03 Lighting
After that, the next sighting is on Akala Island, so go back to the Route 2 motel. Mina challenges you to a battle. Captain Mina has a level 61 Klefki, a level 61 Granbull, a level 61 Shiinotic, a level 61 Wigglytuff, and a level 61 Ribombee. You get 7320 Pokédollars for winning.
Afterward, Looker gives you ten more Beast Balls. Ask him and he says to look in Lush Jungle and Memorial Hill. This time the UB is Xurkitree. It is an Electric type, so it might help to have a Ground type pokémon in your party.
UB-04 Blade/Blaster
After you have caught Xurkitree, go tell Looker. The next sightings are on Ula'ula, so go to the Route 13 motel. In Pokémon Sun, the UB (Kartana) can be found in Route 17 and Malie Garden, and there are four of them. In Pokémon Moon, the UB (Celesteela) can be found in Haina Desert and Malie Garden, and there are two of them.
UB-05 Glutton
After you catch them, talk to Looker in the Route 13 motel again. Nanu says to meet up at the floating restaurant in Seafolk Village. It's in the upper-left of the village.
After some dialogue, Nanu challenges you to a battle. Island Kahuna Nanu has a level 63 Sableye, a level 63 Krookodile, a level 63 Persian, a level 63 Absol, and a level 63 Honchkrow. You get 10080 Pokédollars for winning.
Afterward, Looker says that the final UB is in Resolution Cave. You can get there by going to Ancient Poni Path and going northeast to Poni Grove, then north to Poni Plains, and northwest to Poni Meadow. Then go north in the meadow to find the cave. For more details on trainers and items you can find along the way, read the Battle Tree page.
This UB is Guzzlord, a Dark Dragon type.
After catching the UB, go back to the restaurant in Seafolk Village and tell Looker. Then they will ask you to go to Aether Paradise and meet them in the secret lab with Ms Wicke.
During a cutscene, Looker gives you one MILLION Pokédollars. He says you can visit him at the Melemele motel after that.
"Black Reflector"
Talk to Looker in the motel in Route 2 on Melemele Island and he will mention the black reflector that he saw over Melemele Island. He thinks it was just his imagination, but it was actually a pokémon known as Necrozma. You MUST talk to Looker after catching all the Ultra Beasts to make this pokémon appear. Necrozma can be found in the Farthest Hollow of Ten Carat Hill, but your lead pokémon has to be a lower level than 75 to be able to encounter it. The music in Farthest Hollow will not be different from usual. Use Max Repels and walk around in the grass in Farthest Hollow, and you will eventually encounter Necrozma. Necrozma is NOT an Ultra Beast, so do not use Beast Balls on it.