Go to your Blender configuration folder:
Windows:
C:\\Users\\<YourName>\\AppData\\Roaming\\Blender Foundation\\Blender\\<version>\\config\\
macOS:
~/Library/Application Support/Blender/<version>/config/
Linux:
~/.config/blender/<version>/config/
Copy the file userpref.blend (or the whole config folder) to a safe location. or you can zip it.
If something goes wrong, replace the file/folder to restore your preferences.