By the teaching given us by the Bishops which they learned from their predecessors in an unbroken chain back to Christ.
There is an uncontradictory historical record with sources in (1) the Bible, (2) the writings of the Apostolic Fathers, (3) the writings of the later Fathers, (4) the writings of pagans observing how the Church worked, (5) a continuosu historical witness and assertion of these same promises down through the centuries, (6) the reality of the teaching today being the same as that from the beginning.
We haven't changed. The very first non-Biblical writings by Christians, the Epistle of Pope St. Clement and the Epistles of St. Ignatius, discuss the authority of the Bishops and the supreme authority of the Bishop of Rome in teaching and disciplining. The same theme is continuously expressed from then onwards without any contradiction.
Hwoever, we really knwo this because the linving insitution of the Catholic Church teaches us this same thing today. "He who hears you, hears me".