It depends
At the start of the game, the main focus is to get a monopoly on a tech higher up in the tree, so that you can trade that monopoly tech for multiple tech with the AI. (and all of their gold and other stuff as well) Of course, I try to combine this goal with the goal of getting something I can really use.
Normally this means I go straight for republic, then mathematics, and currency, or literacy. While trading for the other tech.
I may deviate to getting pottery (for a granary) first, depending on the starting location.
And I may self research an unit tech first, If I'm going to have a very early war.
In the middle ages, I usually go for the knight unit, and then straight to cavalry. Then the seafaring tech. (but if I can control my continent before cav, I will go for the seafaring tech first)
In the industrial age, the first goal is steam(rails), then replaceable parts (infantry and artillery) then scientific method for Theory of evolution wonder (that I have a pre-build ready for) and use the 2 free tech to get electricity for hover dam (that I also have a pre-build ready for)
I have little experience with the modern age.