This article explains how to connect a mouse and keyboard to a Steam Deck.
How to 'Dock' Your Steam Deck with a Monitor, Keyboard, and Mouse
The Steam Deck supports a variety of peripherals, which you can connect via USB or Bluetooth. Since the Steam Deck only has a single USB-C port, a USB-C dock or hub is required to connect both a mouse and keyboard. Bluetooth is built into the system, so you don’t need any additional hardware to connect a wireless mouse and keyboard, as long as they use Bluetooth and not a proprietary 2.4GHz system.
The process for connecting a mouse and keyboard to your Steam Deck via Bluetooth also differs depending on whether you're connecting them in gaming mode or desktop mode. It works just like connecting a Bluetooth device to a Linux computer if you're doing it in desktop mode, but the process will vary depending on your Steam Deck's settings menu in gaming mode.
You can connect a USB mouse and keyboard to your Steam Deck if you have a USB-C hub or dock. The hub or dock must have enough ports to accommodate the mouse and keyboard. If you plan on using your keyboard and mouse for extended periods of time, a powered USB-C hub will work best because the USB-C port that connects to peripherals like a mouse and keyboard is the same port used to charge the device.