The way I've been doing it, is I started with the world building to a point, I answered a lot of the more vague and grand questions of the world I had myself at the beginning, like the gods/races/cultures/maps/mechanics/magic. Then I went to the writing part, the characters and the main story...