If you made a dumb mistake, you acted stupidly, without intelligence or common sense. You might be embarrassed if you trip in front of the whole class because you stupidly forgot to tie your shoes.
The adverb stupidly is a fairly blunt and harsh way to describe anything that's done in a foolish way. Even if you think someone acted stupidly, it's more polite to keep it to yourself. Another meaning is "in a dazed way," so you might describe your dad's stunned response to his surprise party by saying, "His mouth fell open and he stood gaping stupidly for a few seconds."