Everybody's process is different. Whichever works best for you is the best way to do it. Me, I get a rough idea, sometimes just a passing thought as to what I need to create, and then I start to map. While I create the map, thoughts develop that compell me to include this or that, so that mapping itself becomes a critical part of developing the lore - and the lore kind of creates itself. Unlike many I don't brainstorm before I make a map, I brainstorm during the making, but I don't know too many people whose brains work like mine.
Its smart to spend the time to develop your concepts before actually doing a map, to give you parameters to work with. Again, there is no best way, whatever works for you, works for you - simple.