we find in sahih bukhari,

Volume 9, Book 89, Number 306:

Narrated Abu Sa’id Al-Khudri:

The Prophet said, “Allah never sends a prophet or gives the Caliphate to a Caliph but that he (the prophet or the Caliph) has two groups of advisors: A group advising him to do good and exhorts him to do it, and the other group advising him to do evil and exhorts him to do it. But the protected person (against such evil advisors) is the one protected by Allah.’

the hadeeth is self explanatory.

please do read the article,

infallibility from quran