You've seen one group of goblins in a 20x20 room, you've seem 'em all. Combat is as integral to Dungeons & Dragons as its fantasy setting, but its easy to fall into certain traps that make it a slog. Most of these revolve around not giving the players meaningful choices.
The first choice players should have in an encounter is whether or not to fight. Unless the players enjoy being the most murderous of hobos, the rational decision is probably not to engage in violence. So you need to balance this reasonable way of thinking with some motivation toward action.
I've written before about goals and obstacles, with combat encounters the most common obstacle to throw at D&D players. But there should be a reason for these combats beyond filling up the requisite number of encounters that will last a session. What are the players trying to accomplish? What are the monsters trying to accomplish, and how does this act as an obstacle to the player characters? Players enjoy combat if they have a clear motivation to overcome the challenge.
This also gives you a clear sense of how the enemies will behave. Are those goblins hanging out in the barracks, guarding a door, fleeing from someone, or something else? They'll react very differently to a party of adventurers in each case, and these tactical decisions by the enemies give players a choice of how to respond. If group of scouts is out patrolling for intruders, they'll probably immediately start running for reinforcements and safety, not hold their ground and fight. Few things in D&D send a clearer signal to players about the pressure of the situation they are in than having some of a group run for help.
The number of foes will depend a lot on what monsters you're choosing, but it's important not to plan on too many or too few. I find that when the players are outnumbered more than two to one is when combats tend to drag on to the point where they have clearly won, but are just "mopping up." Choice has been eliminated. Holding the upper hand so decisively, there is no reason for players to choose to expend resources when they could easily just do a gradual steamrolling with basic maneuvers. This is an especially common occurrence with typical soldier monsters that usually have high hit points or armor class, but middling attacks. .
Choosing enemies from the Monster Manual may present the quickest way to go wrong with planning a combat. Some options are just more interesting than others. I gravitate towards human/humanoid villains, so I spend a lot of time in "Appendix B: Nonplayer Characters” for humanoid enemies, but this is not always a great choice. Take the knight and veteran, for example. They’re both CR 3, with high armor class and hit points, but little or no special abilities. A minotaur is the same challenge and can fulfill a similar role in combat, but has much more interesting abilities that make for a more exciting encounter with more options for the players. Luckily, there’s nothing stopping you from creating a human warrior who uses the statistics of a minotaur in combat. I’ve even had an evil, demon-possessed human knight who fought as a gold dragon wyrmling.
The most obvious technique to selecting enemies that give the players choices in combat is to select more than one type of foe. One of fourth edition's strengths was classifying monsters according to their role, such as skirmisher, soldier, artillery, and more. This was removed from fifth edition but is something you can still look at when comparing monster stat blocks. Have those boring soldiers with high defense guard a damaging creature with low hit points and let the players decide how to deal with the situation. Note that it can become a logistical nightmare for you to run more than two or three different creatures at once in the same encounter.
Almost every round of combat, players have the option to move, but how often is that a meaningful choice? Ranged characters are content to stay in one place as far from the action as possible, and melee characters can quickly become locked in by the threat of opportunity attacks. You can create very engaging combats by breaking this paradigm.
The first tool is the tactics of your monsters. Sure, a risk-averse hobgoblin may not want to risk provoking an opportunity attack, but a dire wolf wants to chow down on the squishy mage rather than armored paladin, and a hill giant is too big and tough to worry about a few pokes dictating where to go. Change the shape of the battlefield and you force the players off of autopilot.
You can also design the environment to encourage choices. Is it better to stay where you are, or try and get to cover? If someone takes out that guy with the ballista, you could use it! And of course, not every fight is worthy of floating platforms that slowly descend into lava, but you are contractually obligated to use that one time once you purchase the Dungeon Master's Guide.
There's more to planning exciting combat encounters than what I've listed here, but hopefully this gives you something to think about. Always make sure you take time when planning not just to balance things correctly, but to consider how this will look at the table, and what sorts of choices your players may have to make.