I wrote a long, detailed, referenced post explaining it, but it puked. So, let me try again.
Heaven and Hell, as understood by xians, does not exist in the OT. H&H are more recent ideas (first through fifth centuries CE) and are mostly detached from jewish tradition.
In the OT, where you see "Heaven" it is a translation for the word "shamayim", which meant "sky".
It was also the place where yhwh lived. The sky was also referred to as "firmament", which was a solid dome over the earth that held back the celestial ocean.
In gen 1:8, the firmament is called "heaven". yhwh's throne was above the firmament. Presumably, this was underwater, given the celestial ocean.
So jews believed in a heaven, but it was not a destination for their souls, really.
As for hell, that is a concept that was developed in a Hellenistic culture, long after jesus H was gone. Where you see it in the OT, it is a translation of the word "sheol", which means "pit or grave" or the underworld.
It was where all
the dead went and not necessarily a place of torment or punishment. When judaism later developed a notion that the messiah would bring the dead back to life, sheol became a kind of waiting room. Because of the Greek culture of the era, it is sometimes translated as "hades", which was a Greek version of the underworld, but not quite the same thing.