Sometimes we build our reasoning and decisions on more or less rational reasoning which consists of logical steps of thought. Let's say, it basically follows the path of problem >> reasoning >> decision.
At other times, unconsciously, our decisions do not come as a consequence of specific steps of thought, but rather as an unconscious attempt to fit our pre-existing beliefs. It doesn't really matter what the original problem was, our mind would find a reason to come to decisions reflecting and justifying those beliefs, no matter the original problem.
Let me illustrate with an example. A person is seriously ill and considering various treatment options. A reasoning approach would be to get information about the pro-s and con-s of each, consult with several experienced professionals, outline and weigh potential risks, chances of success, cost, etc. The belief-fitting approach would be to go for a quack promising complete recovery in no time, regardless of the fact that no other treatment has achieved similar rate of success, while this all-promising one has not become a standard treatment procedure. In this latter case, the inherent and probably unconscious belief would be that "it could not be true that I am irreversibly ill". Whatever facts and explanations that person is given, his mind would seek all possible ways to justify that belief, garnishing the process with all sorts of rationalizations.
Another example would be repressed anger - the mind would seek any situation, no matter if actually connected with the original cause for that anger, to vent out in an outburst.
My question is how is this mental process governing the mind to seek justifications and rationalizations in order to fit its underlying beliefs or emotions, called?