It depends a bit on what the question was and whether you should reasonably be expected to know the answer in order to be competent or not. If the question is on topic, and you are often stumped, then it suggests that you didn’t prep sufficiently.
If the question is off-topic, then it is quite fine to say, “I don’t know”. Moreover, if the question is well off topic and distracting from the lesson, then it a distinct benefit to disengage with a quick short reply even if you, in fact, do know the answer.
You could try deflecting with other replies instead such as, “That’s not today’s lesson,” maybe “I’ll come to that later,” or “I’ll get back to you on that.”
Do not try to bluff the question or give a BS answer just to save face. There are tonnes of stuff my teachers taught me that turned out to be garbage later in my life. It is a hindrance to me to have to relearn the correct thing in adulthood. It is a lead weight around the neck of many others who carry the incorrect knowledge through their entire life and drag the rest of us down with them through their ignorance and prejudice based on false teachings.
In the modern time, there isn’t really a good reason to make up an answer. I frequently employ my telephone to Google information during or between lessons. I also encourage students to look up info themselves. Back when I was a student there was no way to fact check so easily, but today’s internet and mobile services mean that you can find almost anything with a couple of clicks.