There is no "both". Or, rather, if it's science fiction it's also fantasy, but not necessarily the other way 'round.
Yeah, I'm being pedantic again. So sue me.
Within the culture, it's collectively called "speculative fiction." That takes in both fantasy and science fiction -- "SF&F" in the lexicon of the marketing weasels. All speculative fiction
could be legitimately called "fantasy" but not all fantasy is science fiction.
To make his or her work science fiction, as opposed to fantasy, the author must make a good faith effort to comply with accepted scientific theory as it stands at the time of writing. "Good faith effort" here is actually the best construction possible, I think: the writer isn't responsible for being correct, but, rather, for trying hard not to be wrong.
You don't have quasi-magical, unexplained telepathic people in real science fiction. You can have such in fantasy and, sometimes, it can work out really well. I have no problem with fantasy as such; it's just not science fiction.