This may come as a surprise to some, but believe it or not we can know what the Church teaches. For example, the Council of Florence clearly taught that the Old Covenant was null and void; that it would not save anyone, and that it was a mortal sin to attempt to be saved by practicing the precepts of the Old Testament.
Therefore, when the US Bishops claimed, a few years ago, that the Old Covenant was salvific for the Jews, we can be 100% certain that this was rank heresy.
Similarly, the Church has formally condemned the teaching of religious liberty and Separation of Church and State. Therefore, if anyone teaches these, we can be certain that they are in error.
There certainly may be some things where the teaching of the Church is not certain, but when the Church has defined a dogma, or condemned an error, we can be certain on those points.
That is why Pope Pius IX could say that if a Pope teaches something that if false, he should not be followed.