Hello Wendy. When you set up a brand new Logitech Bluetooth keyboard (or even a used one), the pairing process often instructs you to enter a number code but the trick is to enter it on the keyboard that you want to pair, then press Enter to confirm it. This is used to verify that the keyboard actually works, and it also associates it with your computer securely.
You first need to ensure that the keyboard is turned on and in pairing mode - on most Logitech models this is accomplished by pressing and holding the Easy-Switch™ button (1,2, or 3) until the LED blinks rapidly. After the keyboard is detected by your computer and when webpage pairing code is displayed. Type that number code using the Logitech keyboard (not the on-board keyboard on your laptop, etc.) and then press Enter. After that the keyboard should successfully pair.
Here's the reference: https://www.logitech.com/en-ph/setup/mxsetup/keyboard-setup/bluetooth.html
Note: I am providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Best regards,