I am confused on a certain topic. I know the Prophets were protected from major shirk throughout their lives but the other day I remembered the verse where Ibrahim A.S was looking for something to be his lord like the sun and moon and then after he said Allah is worshipped alone. Could you explain?

Ustadh AbdulAziz al-Haqqan
That was before his Prophethood