For example, if my PCs run into a group of bandits, then I will add some spice to the bandit captain. You can do it for full on boss encounters too - in fact you should - but a boss demands a different level of playing around when you're customizing them.
With that said, let's talk.
It's Like Spice, Don't Over Do It
When using stat blocks for enemies from something like a Monster Manual or an Adversary Tome, you need to remember that you're adding spice to a set dish. You add a little or you run the risk of overpowering the whole thing. Now, if you want a custom monster - or a heavily customized stat block - that's fine. But for this we're talking about being able to grab a stack block from a book, and tweak it to give it some character and work.
Player Options Are Great
In D&D 5E I find that feats are great for this. You can take the whole feat, parts of a feat, or - my favorite - parts of multiple feats. For example, with a Sword and Shield fighting monster you can combine aspects of Shield Master and Sentinel. One thing shield master lets you do is use a bonus action to try and knock an opponent down. Sentinel lets your opportunity attacks reduce a monster's speed to 0. Combined? If someone gets knocked down with the shield their speed is also reduced to 0. This ultimately means they can't stand up for one turn or move from where they fall.
Conditional, or an Advancement Work Best
Whatever special stuff your guy can do should be conditional in some way. This means it doesn't just happen. Giving the above shield master example works because the shove is a contested roll. So there is a chance for it to fail. Ultimately I'm just advancing the impact of an ability that is already conditional.
The idea is that the stuff - just like for players - should have a chance to fail. The reason for this is that if it has a chance to fail it probably has to be actively done. Which means you communicate to your players 'this
Don't Do It For Everyone
Remember, this is to make one character in an encounter more special. You can do it for entire units (but this is getting closer to making a custom stat block than tweaking one for a specific character on the fly.) But it works better, and stands out more, if it is for one specific person in a larger encounter to mark them out more.
Out of a group of 5 snipers, one is able to do a special trick. Out of these 12 brigands, one is particularly able to defend themselves with their sword and shield. Stuff of that nature.