This is harder than it should be. Way harder.
Open System Settings -> Privacy & Security -> App Management and give permission to your Terminal program
Xcode-select --install (enter your password)
sudo codesign --remove-signature "/Applications/Discord.app/Contents/Frameworks/Discord Helper (Renderer).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?