It depends on the difficulty level. As the level gets higher, the cost of research for the AI reduces, so it's usually cheaper to buy than to ersearch. Above Emperor you will probably do better by not self-researching, just rely on trading and/or peace nogotiations, at least until you can get on even terms. Below Monarch you may be able to keep up by self-researching. In the middle, some combination is usually used.
Either way, you want gold, and so the first requirement is to exploit river tiles, and to build roads. Most beginners underestimate the value of workers to improve the land, and build cities too far apart to exploit the territory they have. Don't build every improvement without considering its benefits and impacts. You will have to decide whether to use Libraries to enhance self-research, or markets to increase cash for trading. The same options are then available later, with Banks or Universities. Buildings cost you maintenance. Make sure they pay for themselves.
'Slingshots' are good. In C3C, if you can reach Philosophy first you get a free tech. Typically this is used to get Republic or Monarchy, which give two benefits - they improve your economy, if your infrastructure is set up, and they are good trading techs as the AI values them highly. Later on there are two freebies with Theory of Evolution, usually used to catapult you away from the AI in the Industrial era.
You can also take advantage of the Scientific trait. If you have it yourself then you get a free tech at each era change. If other civs have it then you may be able to take advantage of their free techs in trade or peace negotiations.
If you join a succession game you can get a lot of fast-track training by playing among more experienced players. Or read the spoiler posts in the GOTM threads to learn the techniques.