Mechanical no-nos
In no particular order here are some things that will cause poor running of trains.
1. Don't expect the $25 train set locos and cars to work well.
2. Do use track that is in gauge (and keep the wheels of your rolling stock in gauge also).
3. Be careful with rail joiners - make sure the rails are "in" them instead of sitting on top of them.
4. Use enough electical feeder wires so that you're not depending on electricity traveling long distances (> 10') through the rails. A good practice is to run some relatively heavy wires under the rails and bring up another set of feeder wires every 6' or so. Wire sizes can vary from 10ga (for long runs in O scale where the current demands of the locos are higher) to 16 ga (I'd consider this a working minimum).
5. If you're building a larger layout separate it into electrical blocks. Being able to shut off part of the layout will make finding short circuits much easier.
6. You don't need to build a layout like it would need to support a bull-dozer crawling over the top of it. But using 1/4" plywood probably won't give enough support for the tracks. I use 3/4" plywood for joists and roadbed in flat spots (with masonite spline out in the 'countryside') but this is probably overkill for most small railroads - but I don't know too many people whom would wring the hands and cry "Oh woe, I built my layout too strong...".
7. NEVER using the wood in the cheap bin at Home Depot for benchwork. Unless of course you're trying to build a roller coaster. You'll be amazed at how far away from straight that stuff will warp (and split and sometimes ooze sap). Pay a bit more and get decent wood. You don't however need to shop at a furniture/woodworking store (unless you're name is Bill Gates and can afford it). If you have trouble getting wood to stay straight once installed you might consider plywood - not the douglas fir plywood that warps but the Home Depot/Lowes hard wood plywood. It's still not furniture grade but its willing to stay flat (for the most part anyway).
8. When track planning be on the look out for S curves. Track Planning For Realistic Operation has a very good discussion of S-curves and the problems they cause.
9. Use appropriate minimum radius curves for the equipment you like. If you like those nice Walthers full length HO passenger cars count on needing 25" minimum radii. 4-axle diesels and 40' freight cars (HO) will be quite happy with 18" curves and #4 turnouts. When in doubt ask the Hobby Shop employee you're talking to at the counter before buying. Or ask your buddies. Or ask here. "Hey, will such-and-such a car work on my layout with xxx" curves and #xx turnouts?" (but do get a copy of Track Planning For Realistic Operation and read about turnouts, minimum radii, S-curves, and various pieces of equipment).
10. Learning about easements and how to aproximate them is probably a good idea - especially if you're trying to herd long equipment around tight radii. Track Planning For Realistic Operation discusses those too.
11. If you're going to have grades becareful not to have the transition from being on "the hill" to being on "the flat" be too sudden. Especially going up hill. People observing a steam engine crest a hill without enough vertical easement may be heard to cry out "Thar she breaches!" (this was something the lookouts on an old time whaling ship would yell from the crow's nest when they saw a whale coming up out of the water before falling back.) The effect is sort of like Shamu at Sea World except that (hopefully) bystanders at your railroad won't get wet. Make the transistion from hill to flat gradual and you won't have this problem.
12. If you thought the problem in #11 sounded like fun try putting a curve, or better yet a turnout right at the top of track coming off a hill without enough transition (easement). The front wheels of the loco (especially steam engines with their long rigid wheelbase) will lift off the track causing derailments.
Ok guys. I know I'm missing stuff here. What other design/engineer mistakes lead to derailments?
Regards,
Charlie