Hoarding Resources:
Although many people will argue that hoarding your resources is asking to be killed, it can still help you to survive, where, otherwise, you would be dead. For instance, say you were in the first 10 minutes of the game, and you get attacked heavily, and you can't defend it. Well, you could continue to build units to protect your base although you know you're dead, or you could hoard a bunch of minerals and send out some Probes/Drones/SCVs to go locate another location suitable for a new base. If you know of an island base and have transports, then you will be saved completely. However, if you find that you won't get to the location in time to start a structure building, stop somewhere and begin building a small, inexpensive structure, just so you have something to keep you alive. Then hurry to your new location and build your main base. If your "survival structure" that you placed to stay alive happens to be in the middle of the map, or where your enemy will walk, stop if from finishing building before it's too late, so you can get back most of the minerals you put into it. If it is in a spot where your enemy would not look, it may not hurt to leave it where it is in case you get assaulted again.
Units as Precious Resources:
Something else that may help you to keep a strong economy would be to think of each of your units as a valuable resource. What this means is, instead of sending your full assault force to save a small building that has no real significance to you and lose all of your units, don't worry with the building. Basically, just don't waste your units to do insignificant deeds. Don't send them out on suicide missions just to find out what your enemy is doing or just to attack the enemy to keep him on his toes. If you want to keep him on edge, then attack often, but pull back before you start to lose units. If you play as protoss, you can use Hallucinations to keep him on edge (this technique for Protoss is in the Protoss Strat section). By doing this, you will keep a good defense and allow yourself to climb the tech-tree much, much faster than your opponent, and kill him with more advanced units.
Resource Management:
One good rule of thumb to keep in mind is, for every patch of minerals, have about 1� Probes/SCVs/Drones on minerals. For example, if you have 9 mineral patches, then have about 14-15 workers. For gas, if the geyser is a short distance away, put about 3-4 workers on it. If it is farther away, put enough on it so as to always have one guy in there at all times. This is just for your main base. When you expand, don't do so until you start to get short on minerals (unless you need a fast intake in order to get advanced units quickly), this way, when your expansion is done, you can reuse the workers you had at your main base. You don't want to use up supply spots for workers. You want your attacking units to take most of it up. Even after a gas geyser goes dry, keep the workers mining it. It still produces gas, although not much, and you may need it. Never have more than 1 worker waiting outside the gas mine to get gas. Adding more to gas will not get you gas any faster, so don't waste them by doing so. In the very beginning stages of the game (when you have only your first 4 workers), make sure you put each worker on a separate mineral patch. When no more are left, just send them in. By selecting all of them and clicking on one patch, they all will go to that one, and wait their turn to mine. You need them to be getting minerals! Not waiting to get them! Of course, they will eventually spread out, but this takes up precious time. It may seem silly to consider a few game seconds precious, but every second in StarCraft counts!! Never take for anything granted. For instance, say you have tons of minerals piling up, and you need more gas. Don't take workers off of minerals to get gas, because a little while later, you will probably be needing more minerals. When building, instead of using a worker that is already mining, use one that has just been built to build a structure. You don't want to slow down your cash flow. For Protoss and Terran, if you do use a worker that is mining, be sure to use one that has a mineral cluster and is going to return it. This way, immediately after you give the order to building, you can shift-click on return cargo, and he'll automatically return to mining once the building is done (for Protoss, once the warp gate has been activated).
Upgrading:
Don't worry with upgrading until you have a strong defense and you don't have to worry about getting enough resources to build units. It is unwise to upgrade early in the game, because this will use up resources you need for units. Don't upgrade too early unless you can afford it. The main upgrades you should be worried about early on are speed, range, and special attacks (spells). These are the main ones that will do you good, so get these first, then once you have a secured expansion, start getting the others. When getting the weapons/armor/shield upgrades, don't get only one and upgrade it all the way then upgrade another, etc. Instead, upgrade all to level one, then all to level two, then all to level three. This will benefit you more in the long run, and will help you to stay strong.
Expanding:
Before expanding, be sure that your main base is secure and impenetrable. You will have all of your important buildings in your main base, and you can't afford to lose them due to lack of defense. Never expand when your main base is still vulnerable. Never go all across the map to expand. Instead, try to expand as close as possible to your primary base, so as to make it easy to defend and keep. If you must expand far away, do so in an unlikely spot to be found, so as to keep it a secret place that no one else will know about. When you do expand, beware of scouting units in the expansion, such as burrowed Zerg units, Observers, or Marine hiding behind minerals patches. Always run a sweep of the area with a cloak detecting unit to be sure it is safe to expand there. When you find an expansion, try to keep it as small as possible. You don't want a large area to have to defend. Keep in mind that the expansion is merely for resource gathering, and nothing more. Be sure to not overdefend your expansions when resources are low, because it will hurt your overall economy and make you weak. A good time to expand early is when you are very offensive, and the enemy stays cooped up in his base in a defensive state. In this case, expand as much as possible and starve him of resources. This will give you a huge advantage over him. Never wait until your enemy is expanding before you decide to expand. Allowing them to expand first gives them first pick and gives them more power over you, as they will have more land and more resources to build and upgrade with. In short, keep your expansions well defended, but don't overdefend to the point that it hurts your resources supply. Keep a good resources flow at all times, and try your best to cover more land with your own people and starve your opponent.
Recon:
Recon, or reconnaissance, is scouting out your enemy so as to know what he's doing at any given time. Recon is extremely important, especially if you want to know what to build in order to defend against him. Reconnaissance is also known as reconnoitering. One of the best and earliest ways to investigate your enemy is to use a Probe/SCV/Drone to locate his base and gather as much information as possible in a short amount of time. While doing this, you want to try and not make a big deal out of scouting his base. Try to keep your unit off to the side and try to make sure he doesn't see it. If he sees it, he'll get heavier defense and you won't be able to get in anymore. If he doesn't know about your visit, then more than likely he won't be quite as aggressive to you early on. Intelligence in StarCraft is SO important. If you have no idea what he's getting, then you just go about your business and build to defend, and possibly get an attack force. But, if you knew what he was getting, then you know what to do to defend against his attack, or, better yet, how to make an offensive move to hurt him before he can hurt you. Always keep an eye out on expansion points. Never let your enemy make a move without you knowing about it. If you're playing as Protoss, stick some Observers all over the map, and even inside his base, if possible. Think about it. How many people do you see on Battle.net put a detecting structure or unit right in the middle of their base? Not too many. If you were to get Observers really fast, you could send in a few and place them on the interior of his base. If he's one of those people that don't put any kind of detecting unit inside his base, then you have the possibility of keeping it there throughout the entire game! Instant knowledge of what's going on inside his base at all times. If Zerg, you can use burrowed units. If Terran, just use the Comsat frequently. Get about 3 or more of them and scan the map often. For Protoss and Zerg, use the given techniques at expansion points. Stick an Observer or burrowed unit in the area to let you know of incoming expansions. If you have Brood War, then use a Lurker or Dark Templar. This way you can cancel the expansion before it starts. In short, never let your opponent make any moves that you don't know about, and make sure you know what they're building at any given point so you know how to counter it. Never build for yourself. Build to counter their attacks, and this way you always have the upper hand and will be led to victory in the end.
Psychological Factors:
One thing that will help you to victory is, never play afraid. If you keep critizing your own defensese and try to make them better, then you don't take the time to locate his weaknesses and take advantage of them. You will also lose valuable recon as well. Play in a positive manner, and you will not have time for fear. Offense is the best way to go, even if it means simply attacking just to keep him in fear of your next attack. Defense is definitely important, but don't stay so caught up in getting defense that you don't get good offense as well. Keep the other player distracted as often as you can, all while you're getting together your main attack force. The best players are flexible, and just by using the strategy that you always know will let you win will not always work. Make sure that your minor attacks all vary somewhat, so that he'll never know what to expect. If he doesn't know how to prepare, he'll be distracted and lose his pattern of playing. Always know what is important at the current time. You cannot do everything you need to do all at once, so take a few seconds to think about what you need done first, and then do that. Never rush into doing anything and risk screwing it all up. For instance, don't be afraid to use a special effect or spell even if it means hurting your own people. As long as you hurt the enemy more than you do your own troops, it is always worth it. If your base is getting torn down by the enemy, send out some workers and expand like mad. Also, if you know your force can not possibly take on his inside your base, send your people to his base and attack him at his weak points in hopes of drawing him back to his base and leaving yours alone for the time being. Don't get so freaked out about dying that you take stupid risks that you know for certain will help him to defeat you. Don't attack his base if you know your force will die there as well. Use them to go to your expansions to protect them. Always keep a positive state of mind, and try to keep your enemy afraid and distracted. If the enemy is thinking clearly, and you're freaked out about getting up a good defense, then he'll be the one that will dominate, and you will surely fall before him. Basically, don't let the enemy make YOU afraid. Keep HIM on edge throughout the game, and you'll have a huge advantage over him through the entire course of the game.