Thanos spends the first part of Avengers: Infinity War searching for the Space Stone, which is now in the hands of the Asgardian survivors. Only Thor, Loki, Heimdall, and the Hulk are still alive after the rest of the Asgardians were wiped off.
Some viewers may have wondered why Heimdall sent Hulk instead of Thor or Loki over the Bifrost to alert the Avengers about Thanos. There’s a story that Heimdall didn’t send Loki because he’s a bad bet who only wants to cause trouble for himself. Both in Thor and The Avengers, Loki betrayed Asgard and helped Thanos kill off a large number of people.
In Thor: The Dark World, he did the same thing to take the throne and sow devastation throughout the Nine Realms. However, Heimdall may have decided that Thor would be more useful against Thanos, and so he did not dispatch Heimdall to Earth.
However, he may have been worried for Thor’s health as well, given that the Asgardian attack left him wounded and frail. To warn the Avengers of Thanos’s impending threat, Heimdall selected Hulk, a formidable ally with a history of battling with the team.