This information applies to the Nintendo Switch and the Nintendo Switch Lite.
You might need to purchase some extra peripherals to play games using a keyboard and mouse on the Switch.
If you already have a gaming keyboard you like, there are also USB adapters for gaming consoles.

The Switch should detect the keyboard right away.
No additional setup is necessary.
you might even use a wireless keyboard with the Switch.

Just plug aBluetoothdongle into the Switch dock, and it should automatically work.
This will also change the corresponding controls on the keyboard.
Choose your headset from the list of available devices.
Toconnect a Nintendo Switch to a laptop, you need an HDMI capture card like the Elgato HD60.
Alternatively, many Switch games have a PC version that you could buy.