What I try to do is tell people I’ll take a look and get back to them. But I never found a good way to do it confidently, in a way that doesn’t make it seem like I can’t be trusted that I know what I’m doing. Particularly if they want me to do the task in front of them.
Any advice?
You can also offer a "back of a napkin" answer if it's appropriate, but make it clear that you will give it the proper consideration and give a better considered answer. Maybe specify a large margin of error.
All that said, not everything requires rigor. In some cases, "fuzzy" answers are good enough. Learn to identify them and not to waste time giving less important things extra attention.
What will give you confidence is actually following up and getting back to people and closing the thread.
Then people will trust you as well.
They key isn't how you say it, the key is that you consistently do it so that people learn that when you say it, you mean it.