Nearly everyone has accidentally hit the CAPS LOCK key and not noticed until they've done a lot of typing, then have to go back and retype it all. There's various ways of changing how it behaves, some better than others (depending on your needs).
Many OSs have a keyboard option for disabling it, or playing an alert sound so you realise you've pressed it much quicker (sometimes this is hidden in disability support settings). Though this means having to change the setting for every user.
Many businesses rip the key off their keyboards, or slide a couple of bits of hard spaghetti under it so it can't be pressed (giving a less ugly approach, and it doesn't leave an open hole in the keyboard for muck to fall in and cause problems).
I actually want to be able to use the CAPS LOCK key, but would like to know when I've accidentally hit it, so I preferred to set options that played an alert sound when it's pressed, and another so that hitting the shift key released the CAPS LOCK (like how an old mechanical typewriter released the SHIFT LOCK button).
But I found on my current OSs that the sound is muted by the system if it hadn't played any sounds for a while, and takes so long to unmute that it doesn't actually make the alert noise. So, now, I've taken two steps to electronically modify my keyboards, and they handle this problem without needing to do anything to the operating system:
Replace the CAPS LOCK LED with a high brightness one, so it's glaringly obvious that it's been pressed. And if I could buy a rapid-blink flashing high brightness LED (locally), I would have done that, instead. It's quite straight-forward to unsolder a LED and put a new one in its place. The hardest part is opening up the keyboard.
Soldered a low-voltage buzzer across the CAPS LOCK LED (one that will run from about 3 volts DC). It gives a quiet buzz when CAPS LOCK is enabled, the buzz comes from my keyboard where it's obvious without being too annoying, and doesn't rely on the computer having speakers connected or turned up. If the buzzer is a bit too loud, a resistor can be put in series with it, or a diode or two. A series diode may be necessary if your keyboard uses multiplexing that switches LEDs on and off by changing their polarity. For me, putting a buzzer in the keyboard has been the best solution.
And for it's worth, I wish keyboard builders would put the CAPS LOCK LED either in the key, or right next to it, not somewhere else on the keyboard where you barely notice it (and with an obtuse meaningless symbol printed nearby it). They used to do that. And I wish there were more cheap keyboards that are better for typing on. Most keyboards are just plain awful, including many expensive ones.