It may be fair to say that the existence of magic puts a work of fiction in the fantasy genre, and the presence of imagined technology makes any story a science fiction story.
But then doesn’t all fantasy contain some technology? And even some science fiction, like Star Wars, can offer up a modicum of magic (the Force, anyone?). And couldn’t you write a fantasy story—set in a wholly-created world, rife with dragons and orcs—with no magic? After all, anything someone makes, any tool, is technology. And if dragons are just animals, and orcs are just a race of people, then both are possible without working magic in the world. What that means is that authors of both genres will have to pay attention to both magic and technology.
When creating a system of magic or some new technology for your world, always start with character and story.
Writing fantasy and science fiction stories will test your imaginative skills.