Ideally, give trainers a quick brush or wipe-down after every wear. Most of the time, there will be just a layer of dust, which you can wipe off easily. More than that and you may need a brush and cleaning solution.
If you have been working out, sweat/moisture/funky stuff means you will have to concentrate on the insides. If you can, take out the insoles, clean with a brush and let them air separately. If you want to go a step further, remove the laces, flip the tongue over and clean out and air the entire shoe.
I would then recommend putting a deodorising insert inside the trainers overnight. You can get sprays that just add another layer of smell on top, but what you really want is an odourless insert that absorbs all the moisture and scent.
Don’t put trainers in a washing machine. They will come out clean but, over time, the material takes a beating. Also, there are so many materials on a single shoe – plastic, rubber, mesh, glue, suede – and a washing machine isn’t designed for all those different elements. The shoe might take a different shape, peel, crack; the paint might come off. Once cleaned and aired, trainers should be stored at room temperature. If they get too hot, the material can go soft, lose its shape and form. If too cold, certain materials stiffen, which can lead to cracking and breaking later on.