It's not a problem, but you can hide it if it matters to you
In general this isn't an issue. If the players have an issue with you taking a moment to figure things out, they likely don't understand how hard the job of DM can be sometimes. It's something every DM has done at some point and you shouldn't be concerned about doing it unless it is happening multiple times a session.
If it happens a lot
If you find that you need to do this fairly often, more than once or twice a session then you may have an issue. I say may and this certainly isn't a hard and fast rule, however if you find that it happens more often than you like you may need to change your DM style. It's a good idea to work out why this happens. Either you are not preparing enough and regularly have to figure out what happens next. Or you are preparing too much and aren't ready for when things go off book.
If it is because a lack of preparation, you can either prepare more content ahead of time or improve your improvisation skills. There are a bunch of questions on this site that deal with both.
If you are pausing because you have prepared too much and the players went off script. You may want to change the way you prepare to be more flexible. Working on your improvisation skills will also help here.
How to hide it
Occasionally a pause at particularly intense moments can break the immersion. But you also need time to think to avoid a mistake. In these cases I like to cut away on a cliff-hanger and get the players to have a conversation between themselves to give me time to think.
If they entire party isn't heavily involved in a particular moment you can ask one of the non-involved players what their character is doing in this instant. Or you can ask a player to describe the last time they felt this scared/excited/etc. It can be a good character development moment without breaking the immersion. The goal is to get the players to drive the conversation for a minute or two while you think of what to do next.
Alternatively if that isn't appropriate in the moment or doesn't suit your style of game, you can launch into a descriptive monologue. Spend a minute or two describing the scene in intricate detail. While you are giving the meaningless descriptions your subconscious will be working on how to proceed with the story. Often I find that once I've finished describing the scene I have figured out a solution without really thinking.