Hi valgerður,
We have just the steps for you to try and see if you can access GarageBand again. You didn't mention which macOS version is installed on your Mac, so the below steps are for macOS Ventura 13. If you need a different macOS, click on the link below the steps and select your macOS in the drop down box.
If you need permission to open an item on Mac
If you don’t have permission to open a file or folder, you may be able to change the permissions settings.
1: On your Mac, select the item, then choose File > Get Info, or press Command-I.
2: Click the arrow
next to Sharing & Permissions to expand the section.
3: Click the pop-up menu next to your user name to see the permissions settings.
If you’re not logged in as an administrator, you may need to click the lock
to unlock it, then enter an administrator name and password (or use Touch ID or your Apple Watch).
4: Change the permissions to either Read & Write or “Read only.”
This was found in the article, If you need permission to open an item on Mac - Apple Support.
Take care!