system
Given the following post, respond as if you're commenting on Reddit:
human
[MCU/Infinity War] Are Heimdall and Loki Stupid?

At the beggining of IW, We see that Thanos and his gigantic army decimated the Asgardians. But wait a second...

Loki could have just opened a portal to another part of the universe and saved everyone at any moment using the space stone. I can see why he would prefer to keep the tesseract without Thor knowing, but everyone on that ship was in mortal danger, including himself.

And then, there's Heimdall. He could have just opened the Byfrost and saved everyone, but he also choses not to do this.

There were 2 guys on that ship who could have saved everyone at any moment. Why didn't Heimdall/Loki open a portal to earth when they realized How big of a threat They were aout to face? Why were they on that ship in the first place, If they could have just teleported to earth using the byfrost/space stone?
gpt
The most Loki has been shown to be capable of with the Tesseract unaided is to teleport just himself. The last time he held the Space Stone he needed a machine to keep a portal open for his Chitauri Army. He’d grown as a person by the time of Thanos’ attack and didn’t think just disappearing by himself was the right thing to do. 

The bifrost is a machine that Heimdall uses. That machine is gone. Heimdall was only able to summon the bifrost once for one person and he made the best possible choice.