Go to Stanford or Harvard if you can, otherwise if it's too late to get into that club, it comes down to whatever network you can cultivate, along with timing and luck.
Hindsight is 20/20. Don't get too sucked into the casino that is Startup Land.
Go work at BigCorp for big bucks if you're actually adept at engineering. For non-harvardites, everything else is generally a gamble.
If you do work for a startup, make sure to join early for >1% total equity, and if things start to smell funny, don't waste too much time. Every day spent is one you can never get back.