1. Make sure you have a save file from Pokémon Sword and Shield on your Nintendo Switch. If you don't have one, you can create a new save file by starting the game and playing until you reach the first Pokémon Center.
2. Open Pokémon Brilliant Diamond or Shining Pearl and go to the Mystery Gift menu. You can access the Mystery Gift menu by pressing the X button on the overworld map, then selecting "Mystery Gift" from the menu that appears.
3. Select "Get a Mystery Gift" and then "Get via Internet."
4. You will be prompted to connect to the internet. Do so, and then wait for the Mystery Gift to be received.
5. Once the Mystery Gift has been received, go to your Pokémon storage and check the Mystery Gift box. Shaymin should be in the Mystery Gift box.
Note that you can only receive Shaymin once per save file. If you have already received Shaymin on one save file, you will not be able to receive it again on another save file.