One free and fairly simple way, if you're not afraid of the command line, is to use ffmpeg. You can install it with MacPorts or Homebrew if you use either; otherwise you can download prebuilt binaries here:
https://evermeet.cx/ffmpeg/
Once installed, it's a matter of simply: ffmpeg -i path/to/song.ogg path/to/output-song.m4a
There are a bunch of options you can play with if you want to maximize output sound quality and all that, though since you're converting from one compressed format to another, there will necessarily be some artifacting. The default options are probably good enough for most non-audiophiles though.
If you don't want to use CLI, you can use VLC:
https://www.videolan.org (if you have an Apple Silicon system, use the little triangle next to the download button to be sure to download the AS version). Go to "File," then "Convert / Stream." From "Choose Profile," select "Custom," then the "Customize…" button. Under "Encapsulation," select "MP4/MOV", under "Video Codec," uncheck the "Video" box, and under "Audio Codec," select "MPEG 4 Audio (ACC)" from the "Codec" menu. Click "Apply" to close the customize box." Use the "Drop Media Here" section to select your OGG file, then click "Save as File." You can avoid using the CLI, but it's still far more complex than just using ffmpeg IMO.