While using AirPods with the latest generation, make sure that your Mac has the latest macOS Mojave version 10.14.4 or later. AirPods Pro requires macOS Catalina 10.15.1 or later.
If you set up your AirPods with your iPhone and your Mac is signed in to iCloud with the same Apple ID, your AirPods might be ready to use with your Mac. Place AirPods in ears and click either the Bluetooth menu or the volume control in the menu bar on your Mac.1. Then choose AirPods from the list.
Using AirPods on a Mac that is already paired with an iPhone is easy. Just make sure the Mac is signed in to iCloud using the same Apple ID. But if your iPhone gets used by multiple people or needs a different account for your Mac at work, this option may not be possible.
If you connect AirPods for the first time, follow these steps as these are very simple and straightforward.
And if still sound plays from Mac speakers, then click on either the Bluetooth menu or the volume control in the menu bar and make sure that your AirPods are selected as the output device.