There are different concepts of what hard sci-fi is floating around the internet, and public conscious.
My own conception, that I stick to, is that hard sci-fi means any sci-fi where science is more or less adhered to (except with a couple of concessions like FTL, or telepathy, maybe), so adventures like The Expanse and so on count in my own subjective system, and I don't care too much for official definitions. We don't know that anything like an "Epstein Drive" will ever be discovered, but the setting is rigorously grounded in reality, in terms of Newtonian motion and near future colonisation of the solar system. The idea that hard sci-fi has to actually be driven by the exploration of a concept from science as a subject matter, for example, I utterly reject, I see it more as what type of worldbuilding a setting engages in; based in plausible ideas, even if the reality of FTL or something is not currently thought to be feasible, our concepts have been overturned in the past.
In my mind, there is a sliding scale from like "soft" on one end, to Revelation Space on the other.
That also means Star Trek is slightly on the harder side of television sci-fi's scale, for me at least.
It is a franchise that has stretched the believability of what is possible, judiciously hiding concepts behind a fig leaf (i.e. "Heisenberg compensator" being named, but judiciously we are not told how it works), but crucially, has always presented it's phenomena as having an origin in scientific concepts, and built a world that is plausible aside from a few judiciously chosen concepts like near-omnipotent aliens, telepathy and FTL. There are no ghosts or afterlives, nothing supernatural or paranormal. Stargate SG-1 would also be on the harder end of the TV scale, with Babylon 5 and The Expanse perhaps being harder SF still, for using Newtonian spaceflight, etc.
What would be soft sci-fi?
Less than I perhaps might have thought. Superhero shows, I guess, where having a certain gene can somehow open portals (because thats how proteins work lol).... they barely count as science fiction, but claim that their powers are "genetic". Some Doctor Who stories are soft SF (while others are fairly hard SF). Some people would say Star Wars, for having "The Force", but actually, the naturalistic quality of The Force is open to debate (it might be a mere philosophy, projected onto a natural phenomenon), and Star Wars's actual engineering ideas are no less believable than other space operas, as Isaac Arthur has noted on his YouTube channel... so I have my doubts about applying the term "space fantasy" to it, despite it's mythic topics.
A space fantasy, to my mind, is something like Saga, or Spelljammer; something out of "Heavy Metal" where people have spaceships and magic spells, and there is no attempt to claim natural origins of it's powers. As I say, not everyone is going to like this definition, but it's the one I live by, and I think it makes sense.
I think when statistical unlikelihood starts happening, that pushes a work closer to fantasy.