Some ask how popes can be infallible if some of them lived scandalously. This objection of course, illustrates the common confusion between infallibility and impeccability. There is no guarantee that popes won’t sin or give a bad example (the truly remarkable thing is the great degree of sanctity found in the papacy throughout history; the “bad popes” stand out precisely because they are so rare.)
Other people wonder how infallibility could exist if some popes disagreed with others. This, too, shows an inaccurate understanding of infallibility, which applies only to solemn official teachings on faith and morals, not to disciplinary decisions or even to unofficial comments on faith and morals. A pope’s private theological opinions are not infallible, only what he solemnly defines is considered to be infallible teaching.