To avoid this type of thinking, embrace the shades of gray in life. Instead of thinking in terms of two outcomes (one positive and one negative), make a list of all of the outcomes in between to see that things aren't as dire as they seem.
For example, if you have a test coming up and don’t feel comfortable with the subject matter, you may be tempted to not take the test or to not study for it at all, so if you fail, it’s because you didn’t even try. However, this is ignoring the fact that you’re likely to do better if you spend more time preparing for the test.
You should also avoid thinking that the only outcomes of your test-taking are an A or an F. There is a lot of “gray area” between the A and the F.