This is harder than it should be. Way harder.
0. Enable your terminal to make changes
Open System Settings -> Privacy & Security -> App Management and give permission to your Terminal program
1. Install Xcode
Xcode-select --install
(enter your password)
2. Remove the existing signature
sudo codesign --remove-signature "/Applications/Discord.app/Contents/Frameworks/Discord Helper (Renderer).app"
3. Re-sign the app
sudo codesign --sign - "/Applications/Discord.app/Contents/Frameworks/Discord Helper (Renderer).app"
If you don’t do step 0 you’re not going to be able to remove the signature in step 2.
Why is this so hard in 2023?