If you have game save records on your Nintendo Switch system from the Pokémon Sword game or the Pokémon Shield game, you can get the Mythical Pokémon Jirachi as a companion.
Befriend a Mythical Pokémon
Speak to a gentleman in the flower field located on the southwest end of Floaroma Town to add Jirachi to your team.
If you have game save records on your Nintendo Switch system from the Pokémon: Let’s Go, Pikachu! game or the Pokémon: Let’s Go, Eevee! game, you can get the Mythical Pokémon Mew as a companion.