I do it kind of piecemeal. Gross choices first from mechanics, especially class, and then I look for a few key themes (in the narrative sense) to build the character around and I pick details of the mechanics and of the background based in part on how they interact.
Like, in my current character, I looked at Magus and thought it was cool, especially for a gish class, and then I thought well this is a lot like a xianxia character. So maybe my character is from the setting's China analogue. And if it's xianxia, that's basically human with ancient bloodlines, so half elf, and my elf half is the Chinese one with the ancient legacy and the other half can be some local noble or something. Then I looked at details, I saw that a half elf can have an alternate elf-raised version where you are better at magic and get an exotic weapon proficiency, so I figured I was trained in the ancient methods of my mother's line and got her ancient jian (counts-as estoc) and I found that the fiend-blooded trait could make my father a more interesting character and play into my character's mixed bloodline themes, and then that supported taking a Hexcrafter archetype to represent my father's magical heritage (and hexes are cool anyway). And in there, I noticed that the flight hex fits the xianxia theme really well. And then as I was looking at the archetypes, I found that Bladebound would reinforce the legacy of my mother's sword, so I went with that.
In this case, some choices were purely mechanical (feats, spells, two of my three traits) but it's almost all oriented towards a story that I built while picking the options.