If your Official Raspberry Pi keyboard seems to be entering the wrong keys compared to the ones you're pressing, it's usually due to the configuration setting within Raspberry Pi OS.
Go to a terminal window and type 'sudo raspi-config'. Then head to 'Localisation options', then 'Keyboard layout'. What you should need (for UK users) is the Generic 101-key PC English (UK) variant, however if that doesn't work please try the other options listed.
If you're outside of the UK, test the different options for your specific region/language to check which works best for you.