Heimdall is Asgard’s all-seeing, all-hearing guardian stationed on the Bifröst rainbow bridge to watch for attacks. He earned the position when he saw an army of giants marching to Asgard when they were still a few days away. The Asgardians marshalled their troops and defeated the attack before they could do any damage.
Stan Lee, Larry Lieber, and Jack Kirby created Heimdall, introducing him in Journey Into Mystery #85 (October 1962). In his first appearance, Loki had been magically imprisoned in a tree and would only be released if someone shed a tear for his plight. Loki manipulated a leaf to poke Heimdall in the eye so that he would cry and Loki was freed.
Later, Heimdall warned Odin of a threat he felt was coming but could not see, so Odin used his magic to discover a wind sprite – one of the beings that Heimdall couldn’t see. Odin praised Heimdall for issuing the warning even if it meant being ridiculed if he was wrong.
He fought Thor in a few early stories, including trying to prevent him from leaving Asgard to be with Jane Foster, and in another instance when Loki was in command.
During the prophecy of Ragnarok, Heimdall severed the rainbow bridge then traveled to Earth with Kamorr to find humans that could become gods. Once he found three candidates, Heimdall exposed them to Ego-Prime’s energy and they were established as the Young Gods. Then, he took the Asgardians to the Dark Nebula.