The first step, when you want to maintain a washing machine, is to eliminate bad odours. These can develop over time, and can even make the clothes smell bad. Regular cleaning of the window seal and detergent tray is key. From time to time, you can also do a high temperature wash with the addition of white vinegar or specific washing-machine cleaner products to eliminate bacteria.
Finally, be sure to leave the window open when the washing machine is not working and most importantly, remove the washed clothes from the drum as soon as the wash cycle is over.