I just get too focused on wanting hammers hammers hammers so I end up making more farms to use more mines
There's nothing wrong with that. Take a glance at the one of the saves from my game, and you'll see a distinct lack of cottages (the ones I did build were only meant to be temporary, but I kept forgetting to farm over them), and a whole lot of farms and workshops/mines.
Specialists, trade routes, and naturally commerce-rich tiles (inc. coasts if you're Financial) can handle the sciencey side of things. Often, the best way is to alternate between periods of research/GP generation, and periods of military and/or infrastructure production. The anarchy from civic changes can be a problem (unless you're Spiritual - that trait is unsurpassed for this approach imo), so you'll need to plan ahead, and use your Golden Ages wisely.
What you can't afford to do is have your cities generating the maximum possible hammers at all times. You either need to have:
(i) mixed production/science cities (the weakest choice imo)
(ii) cities that can switch between production and science
(iii) two distinct classes of city - some pure production, some pure science.
(iv) some combination of the above
(Generally, with a farm-based economy, I'll go for (ii), but with a few highly specialised production or science/gold cities. With a cottage-based economy, it's always (iii) for me. In either case, having at least one city that spends most of its time generating GP points is very important.)
You also need to make sure you don't restrict your cities' growth by working too many hammer tiles (or specialists) rather than food ones. This is something I did a bad job of in my game - in my rush to get temples and cathedrals built, new cities settled, and GPs generated, I neglected to let my cities grow as large as they should have been.