Chains are where you can get a lot of grit and just plain dirtiness accumulating so it’s something you should clean and maintain on a regular basis. If you need to install a chain, remember to get one that is compatible with your system because the larger the number of sprockets you have on your bike, the thinner the chain you will need. A thin chain for a 10-sprocket bike can theoretically be used on sprockets designed for wider chains.
The inverse is not true. You cannot use a chain from a single-speed bike (wider sprocket) on a 10-speed (thinner and multiple sprockets).