Work through these in order.
1. Toggle Bluetooth
Open Control Centre → Bluetooth, turn it off, wait a few seconds, and turn it on.
2. Check the device
Charge it, turn it off and on, and make sure it isn’t connected to another device nearby, such as your iPhone or iPad.
3. Forget and pair again
In System Settings → Bluetooth, hover over the device, click ⓘ and choose Forget This Device. Put it in pairing mode and connect it again.
4. Restart the Bluetooth service
In Terminal:
sudo pkill bluetoothd
macOS restarts it within seconds. Every Bluetooth device disconnects briefly.
5. Restart the Mac
It clears most stuck states.
Check the battery
Low battery causes dropouts. NotchMind, which I make, shows an accessory’s battery in the notch when it connects, for devices that report it. See AirPods and Bluetooth.
NotchMind