Yes if you have a cold virus you should stay home from work until you've recovered from the cold virus.
If you go to work with a cold you won't be able to focus anyway and you could spread the cold virus germs to your Coworkers.
Stay home from work until you feel better after the cold to prevent the spread of germs.