Sometimes, the keyboard and mouse (trackpad) will stop working that came with the tablet.
This is a magnetic keyboard/trackpad that attaches directly to the tablet.  (below)
The highlighted red area can sometimes bend and disconnect but still be magnetized. 
I recommend fully detaching it, then rebooting the tablet.  After fully rebooting and logging in using touchscreen, try connecting and magnetizing it back again.  Making sure the two prongs are going up into the tablet.   See if that works first. 

Another option... For Windows 11: Go to Settings > Accessibility > Keyboard (scroll down to the Interaction section). To adjust the settings, toggle the settings to either on or off, depending on your preferences.

If this doesnt work, you have two options, send the keyboard/trackpad back to me and i'll ship you a replacement.
OR get a bluetooth keyboard/mouse combo from best buy.   (Logitech - MK235 for $20) and it will connect via Bluetooth.