Kind of a sandwich approach. Flavor first in the broadest sense, like “I want to make a pirate adventure” or “I want a one-shot set in a sewer,” or “this encounter needs to introduce the werewolf theme of this adventure.”
Then, tinker with the mechanics until the math works, since that’s the part that needs the most direct attention.
Then, given whatever mechanics I’ve come up with, go back to the aesthetics and flavor and figure out how it works. If I decided an enemy is ranged, how does it fight at range? Is it magical, or throwing things, or has a weapon?