It is always a good idea to tell us which version of the operating system and which version of
OpenCPN you are using because the different versions might have a different behavior.
macOS has 2 folders called Library. One is for the system itself and there should not be altered anything without knowledge.
The other one is in your home folder: So change directory (cd command) to /Users/yourusername/Library/
and there go to:
/Users/yourusername/Library/Preferences/opencpn/
and make a new folder layers. Result is then:
/Users/yourusername/Library/Preferences/opencpn/layers/
Here goes your gpx files.
Depending of your macOS version the folder Library in your home might be a hidden folder.
It is also useful to read the online help.
Gerhard