Well, fantasy typically focuses on the supernatural and the impossible within a fictional world. It can draw from folklore and mythology. Science fiction is more about exploring the potential consequences of scientific and technological advancements. Fantasy might have a more timeless quality, while science fiction can be more closely tied to the era of its creation in terms of the technology it imagines.
In fantasy, the rules are often more fluid and based on magic or some otherworldly force. It doesn't have to adhere to the laws of our known physics. However, science fiction tries to be somewhat plausible within the realm of scientific theory. Fantasy stories can be set in a completely made - up world, but science fiction often projects from our current world and speculates on where technology could take us, whether it's about artificial intelligence or interstellar travel.