It was impossible to defeat Karna as long as he was in possession of the earrings and armor gifted to him by Surya, the Sun God. The story as to how Karna lost his earrings and armor is mentioned during the Kurukshetra war in the Mahabharata.
One day an old man came to Karna begging for alms. Karna gave the word to the old man that he will gift whatever he asks.
The old man immediately asked for the earrings and armor of Karna.
Both were part of this body since the day of his birth. It was like a part of his body.
Karna knew losing them meant he would become vulnerable to any weapon. As long as Karna wore the earrings and armor, he was impermeable to any weapon.
To keep his word, Karna parted them. He cut them off from his body and gifted to the old man.
The old man was Indra, the king of Devas and father of Arjuna. He had come to secure them, as he knew the Pandavas could never win the war and it also put the life of his son in danger.
Indra was overwhelmed by Karna’s selflessness. He revealed his true identity. He then gifted Karna a celestial spear that never missed its mark. However, it can only be used once.