Something like this should be default in MacOS. I use blackhole daily in my audio production and sound design practices. If you use a modern audio interface you might have a loopback available there.
https://developer.apple.com/documentation/coreaudio/4160724-...