Combat is a huge part of DnD, and generally it's intrinsically fun on its own. There's room for strategy, quick thinking and specialization through classes and spells. But, there's always room for improvement, and I have found in my own games that combat is often where sessions slow down as players decide what to do. That's totally fine, but here's how to keep things interesting despite the change of pace.
1. Have enemies talk
Most of combat is swinging weapons or casting spells. In real life if we were doing these things it would be exhausting and wouldn't leave much room to talk, but this isn't the real world. By having enemies talk not only to the players but to one another, you can keep people engaged through listening to clues about enemy motivation and tactics. It also provides even more space to deliver NPC backgrounds, make your players hate the bad guys even more, and makes more sense when your players strategize since the enemies are doing the same thing.
2. Involve Innocent Bystanders
This works on both sides of the good/evil spectrum. For good aligned characters, this is another thing to worry about and deal with. Trying to get people to safety, protect the innocent, these elements add further tension to combat that provides more satisfaction once the combat is resolved. For evil aligned characters this means human shields, people to threaten, ways to enact vengeance for injuries.
Build your maps around the encounter rather than the other way around. Your party has no flight abilities but your enemy does? Then have the combat area be two-tiered to create another problem for the players to overcome. Enemy is super strong but has a damage vulnerability? Set up a part of the map that deals that kind of damage. The more you force your players to move and think, the more engaging the combat will be.
4. Increase Tension
Basically, have the combat evolve as it goes. This can come from enemies, environment, or both. Sometimes this might mean playing with an enemy stat block to make them stronger the closer they get to death, or imposing time limits through round-based consequences. Perhaps the lava you introduced at the beginning of combat at the back of the room is slowly creeping forward and engulfing everything. Or the NPC the players have been sent to rescue has been poisoned and her condition is worsening with every round. Impose stakes and people will pay attention.
5. Provide Clear Goals
Show the players what the point of the combat is. If the goal of every one of your fights is for the players to survive then something is wrong. It's okay if the goal is simple, like getting through a door or killing a boss for plot reasons, but it's important that the players don't lose sight of the reasons behind a fight. Getting into combat because it's just that time of the session is less interesting than combat for an ancient artifact or to protect a lord.
Combat is interesting when it has stakes and it's tense. Often this comes from keeping the players in danger, or keeping people/things the players care about in danger. But beyond that it's about staying in character, keeping up the facade of the roleplay, and engaging as much as possible as if combat was no different than any other part of the game.