A quick and simple way is to use an application called Black Hole.
Once you have installed this, open up audio MIDI Setup
Add a Multi-Output Device as an option and tick both MacBook speakers AND BlackHole.
Then open up sound preference and route the sound through the multi output device.
Then select Black Hole as the audio input in OBS Studio.