Normally to get
and \ the right way round for a British keyboard you need to change the keyboard layout toBritish - PC`, and you need to convince MacOS that you have an ISO keyboard, rather than an ANSI one. This is described in this closely related but not duplicate question. The solutions there have worked for me in the past (see my answer to that question).
However, I just got a new Mac, and I am now running it through a Thunderbolt 3 dock and a KVM switch, and that seems to have confused it somewhat.
When I run the keyboard type identifier it says they keyboard type cannot be identified:
If I click "Skip" it defaults to JIS - I definitely don't have a Japanese keyboard!
If I select ISO then the problem remains - @ and " are the right way round, but \ and ` are not.
How can I fix this? Note that I do have Karabiner-Elements installed, but unlike in previous versions there are no options to change the virtual keyboard type in it.