[<< wikibooks] Introduction to model railways/Cleaning
Keeping the track and wheels of your model clean are essential for the reliable operation of your railway. 
When the model is not being used, keep it covered with a dust-cloth.
You can also help “design out” some of the dust problem if you have built a proscenium over the layout (this also provides somewhere to mount your lighting, and potentially storage on top)
The frequency and type of cleaning technique used will depend on the amount of track you have, what type of track and how accessible you have made the layout.
Track and stock cleanliness will also be affected by whether you are creating a lot of dust in your model room, how much paint spraying you are doing and other environmental issues (damp, humidity etc)
Whilst much focus is in cleaning the rails, it is important to keep wheels clean, especially any plastic wheels, which are prone to collect dirt and distribute this around the layout.
Note: This section is aimed at indoor railways. Garden rail layouts have a whole different level of issues to address!
Track cleaning methods.

Remove dust first with soft brush and small vacuum (e.g. computer vacuum, dustbuster etc)
Track rubber - followed by a clean with IPA - various manufacturers (However, some users find that they leave little bits everywhere, including stuck to the top of the rails, where, being insulating rubber, the bits actually make running worse. They also scratch the top of the rails which produces lots of small ridges [see also emery cloth in 'things to avoid' below]. The ridges encourage sparks which erode the wheels and track and is partially responsible for the dirt that accumulates on wheels! Rough rails also encourage wear and corrosion. The corroded metal is a very big cause of the dirt on wheels and is an insulator.
Hardboard (the type with a smooth side and a 'rough' side) - 'rough' side down. This actually polishes the rails but is tough enough to remove the softer dirt. Use the edge and 'elbow grease' if the dirt is too tough. Regular use should keep on top of the dirt and stop it building up too much.
Cardboard (acts as a track rubber) then IPA
Soft cloth and IPA
Cotton buds and IPA
Track cleaning wagons (IPA and track cleaning pads fixed to purpose made rolling stock (from a variety of manufacturers eg CMX, Dapol, ROCO etc)
Noch axle hung track cleaning pads which will fit  majority of rolling stock
Rub track with graphite (artists pencil, carpenters pencil, 6B pencil)
Use an electronic unit attached to your power supply (DC Only)
Acetone (nail varnish remover)
Specialist track cleaning fluids are available (e.g. Goo Gone, Track Magic, Dapol Track Fluid, Railzip)
Ballasting. This can cause problems, especially around points. Excess ballast and glue should be cleaned up using flossing sticks, cotton buds and IPA.Wheel cleaning methods

Autosol metal polish
IPA
Fibre glass pen
Purpose built motorised track section. Fibre glass rods are vibrated as the train runs. Install this either on a main line, or on a purpose built siding, accesible by all rakes/locos.
Wet a j-cloth or similar with IPA. Put one set of loco wheels over the cloth, with one set of wheels directly on the track. Apply power to getbthe wheels turning, while holding the loco. The wheels spin on the cloth and will get cleaned. Keep using fresh bit of cloth to monitor progress.
Woodland Scenics wheel cleaning system
Peco and Gaugemaster wheel cleaning systems
rotary tool with soft brass brush wheel
Bachuras Wheel Doctor.
Halfords electrical contact cleaner on cotton buds to clean loco wheels and pickupsLocomotive cleaning
If in doubt, leave this to a specialist! However there are some things that can be attempted by the novice. 
Clean the pick-ups occasionally using the likes of a micro tip brush which is ideal for getting into tight areas
Things to avoid
Don’t over-lubricate - this will attract dust.
Do NOT use emery cloth or similar. The temptation is great, but the micro-grooves left will simply attract more dirt, quicker.
Do NOT use WD-40. Whilst this is often a miracle cure for many things, it is not good for cleaning track, or lubricating locomotives.
Controversially, some people use ATF (automatic transmission fluid). Although it does have conductive properties, oil on the track will act as a dust attractor, and lead to increased wheel slip. Others will claim good results from ATF; this might be down to the different scales used, so it could be a viable alternative in some cases.