This is such a generalized question. It depends on so many different things like your race, the difficulty, how many leaks you get, how much money you have, what your maze is, how good your memory is, how well you know the race you have, how well you know the level's armors and stuff, etc... In general, if you're about to die and the creeps are more than halfway through your maze, sell it and build a stronger tower. Start selling from the beginning of the maze, selling only what you need to get a better tower (your ult or something good for the level is recommended). Also: Never ever ever ever upgrade towers (unless of course you are the random race...or some other circumstances). Sell them and build the upgraded one. You save more money that way.
As for which towers to build...that really depends on the race. I don't really have the time to go through all of the races and which towers are good or not, maybe I'll do that some other time, but this really depends on your knowledge of towers and how "useful" they are.
Maybe if we're on at the same time I can show you sometime. But I usually only ever play if I'm red because I choose unpossible/ar (yes, unpossible. Sounds better than impossible) modes. Insane is pretty boring.