Like every other mainline Pokémon game, Pokémon Sword and Pokémon Shield feature legendary Pokémon that the player can catch. If you have Sword, you can get Zacian. If you are playing Shield, Zamazenta is the Legendary Pokémon you can catch.
The latest generation of Pokémon games mix the formula a bit this time. In the past, you've always been able to receive at least one Legendary Pokémon before taking on the Elite Four and attempting to become Pokémon champion. This time, however, you won't be able to get it before the league match either.
In the Sword and Shield, your last game to become champion of the Galar region takes place against Lee. After defeating him, the credits will go down, but don't worry; the game is not quite over yet!
After looking at the credits and resuming the game, you will return to your home, where you originally started the game. Professor Magnolia will come to your house and give you a Master Ball to help you save Galar. This ball never misses, no matter which Pokémon it is thrown at, so save it!
Go to the Sleeping Weald, where you obtained the sword and shield that summon Zacian and Zamazenta. The hops will be here and challenge you to a battle.
After the battle, you will be challenged by two brothers who claim to be of royal lineage. Defeat them to get the sword or shield back. The hops will lose each other, and your future mission will be to hunt them while you fight against the dynamized Pokémon in almost every gym they participated in during the gym challenge.
You will know that you are near the end when you fight one of the brothers in the basement of the Hammerlocke Stadium. This is the same area where you fought President Rose.
After defeating it, you will take the elevator to the roof, where you will fight any Pokémon that is not in your cover. If you are playing Shield, this will be Zacian. If you are playing Sword, you will have to face Zamazenta.
During this fight, you CANNOT capture the legendary. Do not even try. You have to defeat him in battle, which he will call the other legendary. During this fight, the Pokémon on the cover of your game will be catchable. Use your Master Ball and you will get Zacian or Zamazenta.
Return to the Slealing Weald, where Hop will comfort legendary Pokémon defeated in battle. Then he will take the legendary himself and challenge you to one last battle. This is the last battle before the actual game ends, so be prepared for a tough battle.