It depends what’s gone wrong in the Mac. If the sound chip has failed then external speakers won’t work either.
Can you not put some headphones in the back of the Mac and test? If they sound OK then external speakers will too.
If the sound chip has failed you could buy a cheap USB audio interface like a Focusrite Scarlet Solo (cheap but good) and connect headphones or external speakers.
I have an audio interface driving my studio monitors, once you get an audio interface you never go back to using internal audio! It’s something you’ll use for years even when you update your current Mac.
You’ll be amazed how much better a good quality audio interface can sound over internal and PCIe sound cards.
There are also very cheap USB soundcards for < $10 on Amazon but I have no idea what sort of quality you can expect. A good quality audio interface will last you a lifetime but one of these cheap solutions may be all you need?