Ever had a moment where you're reading a book, and a character's about to do something really stupid, and you tell them over and over again not to do it...and then they do it anyway and consequences and repercussions and downright chaos ensue?
The thing is: sometimes a character isn't stupid, but they make stupid decisions. And while the reader is clear-headed and going, "Why would you do that?!" the character most likely isn't thinking that clear-headedly (is that a word?), which brings me to my point:
If your character is going to make a bad decision, at least give them a good reason for it. We've all done things that might not have been the smartest at the time, but think: to you it made perfect sense at the time, right?
Your characters are more than likely going through the ringer. Or the blender. Or something that chops them up into little pieces emotionally, physically, mentally, etc. Which means they're not thinking straight. So while the reader is sitting there going (again), "Why would you do that?!" you, the author, are in charge of knowing that "why" and making sure that it's not for a stupid reason (i.e.: they haven't thought of a smarter, easier, more obvious decision that everybody else can see clear as day for no better reason than, "Just because.").
What motivates bad decisions? Desperation, anger, grief, determination, fear. There's more, but those are the ones that I, personally, enjoy looking at. Basically: event A happens, it has some kind of effect on your character, and that leads them to performing actions that lead to event B (yes, no matter how much you yell at them).
Just make it natural. It's a good way of making well-rounded, three-dimensional characters if you know them well enough to be able to write out their decisions in ways that make sense. For them, it might be the only option; maybe they need to speed up the timeline of a previously-conceived plan; maybe they act on a plan that was previously shot down because of its bad-idea-ness; maybe they're simply emotionally distraught and they act without truly thinking based on why they're distraught. The list goes on, I promise. Whatever it is, you can bet they're thinking more emotionally than logically.
Which, while bad for the character, it's good for you: bad decisions make for great plot points. Things tend to go really bad, and it might, then, have some kind of profound effect on your character: it helps along their character arc in some way.
However, just make sure you're leading both the character and the reader into the bad decision in the right way: don't make the bad decision happen randomly just so you can keep the plot moving; you don't want your readers to think that your character's simply an idiot. Make the decision logical for your character and their development; have it play into their emotions and their motivations, and think about the events that lead up to the bad decision.
If I'm not making much sense, try these posts on the same subject from Helping Writers Become Authors and Ava Jae.
Sometimes good characters make bad decisions. What to think about when characters don't think straight via @Rae_Slater (Click to Tweet)
If your character makes a stupid decision, give them a good reason. @Rae_Slater gives you hints on what to think about (Click to Tweet)