Many people assume that because the pope can speak “infallibly” that we Catholics think he’s always right. For example, if the pope says 1+1=3 then it must be true! In reality, that’s not what infallibility means.
Infallibility is the prevention from teaching error. This is different from “always being right”. If a pope didn’t know the answer to 1+1, and he where infallible about mathematics, he would be prevented from answering the question. The question would remain unanswered until a pope came along that knew the answer. That’s how infallibility works.
Infallibility also has nothing to do with being sinless. Some people think that because many popes have been sinful (well, all popes have been sinful, who am I kidding?) that they must not be infallible. The fact is that being sinless is not a requirement for teaching infallibly; they aren’t related at all.
We’ll talk more about infallibility at another time. However, it’s important to understand that the pope cannot just make stuff up and it’s therefore true. The Holy Spirit protects from error but doesn’t guarantee that the correct answer will be given.