If you've got a great story idea, I'd write that first and then make the world match the story's needs. However, you want to make sure the world would function logically the same way even if the plot weren't carried out. That is to say, don't make absurdly convenient world building choices just to make the plot work. Readers will often pick up on that. "How convenient that the social tradition requires a man and a woman go on this adventure together so the main characters could fall in love!"
Sometimes the opposite happens and writers will spend so much effort on the world building that the story will suffer because the writer can't kill their darlings and cut out unnecessary details.
It's a balancing act.