Every now and then, you can receive special in-game gifts from Nintendo/The Pokémon Company. To find out if a gift is available, you can try checking the official websites, or the news channel via your Nintendo Switch. To receive a gift, go to "Communicate" from the main menu, then "Mystery Gift" on the left.
You must be connected to the Internet to receive a Mystery Gift. Also, you may need to have the latest System Update installed on your Nintendo Switch. However, you don't need to have a Nintendo Switch Online subscription.
If successfully, you'll be shown given the following choices:
Get via Internet: Choose this to search for a gift that's available to everyone via the Internet.
Get with code/password: If you've got a unique serial code or a common password, use this to input it and receive your gift.
Get with a Poké Ball Plus: Select this to receive your bonus Mew from your Poké Ball Plus. This can only be done once per Poké Ball Plus.
Check Mystery Gifts: Look up Mystery Gifts you've already obtained.
After receiving a Mystery Gift, it will be sent straight to your Pokémon Box, if it's a Pokémon. Or straight to your Bag if it's an item. Your game will also be automatically saved.