For that, you’ll have to download a third-party app, like Soundflower. It also lets you record external audio - anything coming in through your mic - but the Mac’s built-in options don’t let you record internal audio.
Luckily, Macs have this feature built in ( your iPhone does as well), letting you record part or all of your screen. Whether you want to save a video of what’s playing on your screen, share what you’re looking at with friends, or film a tutorial, recording your Mac’s screen can come in handy.