It was as always: you program by writing code and test it, not googling around for inspiration.
This being said, you always needed some prime information. the first source was k&r. Then you had some primer manuals like the “the c primer”. Then the next source was your compiler’s library reference manual (paper). Back in 1985 there were not so many free libraries. You had to purchase some, and again rely on tutorial and library reference and try it yourself until it works.
Later you also had some nice magazines such as Dr.Dobbs, Byte, the C Journal and the C User’s Journal (both of which ended to merge). These had reports about cool tools or libraries to purchase, programming techniques with source code, etc.
The main difference was that you had to search much more by yourself (try and error), and share experience with peers. And if you could afford a modem, you could enjoy the small community of a BBS forum hosted by some volonteer.
And programming then was as fun as programming today, even if the productivity was lower.
how did people write programs like text editors or web browsers before you could google up headers and other libraries?
Back in the Jurassic (’60s through the early ’70s), everyone used the hardcopy programming manuals and development tools that came with the system. There weren’t a lot of third-party tools or libraries to choose from, mainly because there were almost no open standards.
Sometime in the Cretacous (late ’70s to early ’80s) people started putting RFCs, manuals, and code on Usenet, but you had to know where to look.
By the late Cretacous (late ’80s) you could use tools like Archie and Gopher to efficiently search for manuals and code online.
Mosiac was the KT impact. That’s what signaled the sea change towards network-centric applications and programming.
Remember that hardware capability has to evolve before people can take advantage of it in software. It wasn’t that long ago that 256K was a lot of very expensive memory, and everyone had strict quotas on disk space. My school had a couple of hardcopy terminals still lying around. There’s a constant feedback between programmers pushing the hardware and hardware manufacturers offering new features.
The same way they shared information on any other matter – by writing books, attending talks, formal training, manufacturer’s manuals, that sort of thing.
Just to add to this, conio.h is a DOS header from about 1985, and using that in code today is an absolute joke. So is C, for that matter. The information you’ve found online is of laughably low quality. Not exactly a resounding win for the Google era. You might find useful a question about “How do I find information that isn’t total garbage?”.