"Audacity Cannot be opened because of a problem"

Try resetting Audacity according to these instructions: https://forum.audacityteam.org/t/resetting-audacity/50613/1

Then download the current version (Audacity 2.3.3) via the Audacity website: https://www.audacityteam.org/download/mac/
Installation instructions are provided on that page.