The Fantasy and Science Fiction genres are distinct in several ways, but there is a certain degree of overlap as well. Both of them specialize not in things as they are but in things as they might be. They may differ in where the emphasis of the story goes — SF is notorious for typically making “the idea” and its consequences the point of the story, not necessarily the characters — but in this post I want to concentrate on what they have in common.
I’ve read SF&F all my life, and the two genres are cross-fertilized for me now. I like my SF best when it has moral characters as well as ideas, and I like my Fantasy best when its magical or supernatural elements are treated consistently, as though they were science.
It’s a truism in an SF story that you can change just one thing arbitrarily (time travel works, men live for centuries instead of decades, there are sapient aliens we can meet) and, if you can do an adequate handwave in the direction of scientific plausibility, the reader will accept it, as long as the notional basis is scientific (rational). For example, there may be religion in SF societies, and there may be powerful beings who seem to be indistinguishable from gods, but you can’t have real gods (supernatural entities) as agents in SF (though you can have a belief in them). That’s because god(s) may or may not exist, but science has nothing to say on the subject. That’s why they are literally “supernatural”, not “natural”.
What you must do in SF, however, is deal with the change consistently, e.g., if men live for centuries, there will be social and economic consequences. The story can be about those consequences, or they can be a background to the story, but they must be consistent, and a very great part of the pleasure of reading SF is the exploration of the consequences of such an idea.
Fantasy is a broader category. It accepts that those areas where it differs from quotidian reality may not be capable of rational explanation. Hence you can have supernatural entities (gods, elves, demons) as well as beings that might or might not be supernatural (vampires, werewolves, dragons).