A Bluetooth speaker that shows connected but stays silent is almost always a wrong output selection, not a broken connection. Windows can be connected to the speaker while still sending sound to the laptop, or it can be using the low-quality Hands-Free profile, which carries calls rather than music.
Fix it, in order
Select the speaker as the output. Click the speaker icon on the taskbar, then the arrow next to the volume slider, and select the Bluetooth speaker. Then check the volume slider itself, since Windows remembers a separate volume per output device.
Pick the Stereo profile, not Hands-Free. If two entries for the speaker appear, choose the one without Hands-Free in the name for music and video. The Hands-Free entry is for calls and sounds thin and quiet, and Windows sometimes picks it by default.
Check the volume mixer for the app. Right-click the speaker icon and select Open volume mixer. The app you are playing from may be muted or set to a different output device, even while the system volume is up.
Disconnect the speaker from your phone. A speaker connected to a phone will not play sound from the PC, even when Windows says connected. Turn Bluetooth off on the phone for a minute and test again.
Remove the speaker and pair it again. In Settings, Bluetooth and devices, Devices, select the three dots next to the speaker, choose Remove device, then put the speaker in pairing mode and add it fresh. A stale pairing can connect without ever starting the audio stream.
Restart the Windows Audio service. Press Win + R, type services.msc, and press Enter. Right-click Windows Audio and select Restart, and do the same for Windows Audio Endpoint Builder.
Update the Bluetooth driver. In Device Manager, expand Bluetooth, right-click the adapter, and select Update driver. If the speaker works on a phone but never on the PC, the PC's Bluetooth audio driver is the suspect.
Two entries for one speaker is normal. Windows lists a Stereo entry for music and a Hands-Free entry for calls, and picking the wrong one is the single most common cause of a connected speaker with no sound.
If it still happens
If the speaker plays sound from a phone but stays silent on the PC after re-pairing and a driver update, test with a different Bluetooth audio device on the PC. If that one is also silent, the Bluetooth audio service on the PC is at fault, so check that Bluetooth Audio Gateway Service is running in services.msc. If only this speaker is silent everywhere, reset the speaker to factory settings using its manual.
Common questions
Why does sound still come from the laptop when the speaker is connected? Connection does not change the output. Windows keeps playing through the previous output until you select the speaker in the taskbar volume menu or set it as the default in Sound settings.
The speaker is connected but only plays in calls, not music. Why? Windows is using the Hands-Free profile, which is for calls. Select the Stereo entry for the speaker in the volume menu, and close any app using the microphone, since that forces the Hands-Free switch.
The speaker worked yesterday and is silent today. What changed? It probably connected to your phone first. Turn Bluetooth off on the phone, toggle Bluetooth off and on on the PC, and select the speaker as the output again.