It sounds trivial and obvious, but it's not. Every morning, before going to work, you should wash your beard thoroughly. You have to give it the same importance as you do your hair. Just as specific products are used for hair (anti-hair loss shampoos or anti-dandruff shampoos for men's beard care), it is also important to use a mild shampoo.
Using normal soap to wash your beard is a mistake, as it damages the skin. In addition, beards contain many more germs and bacteria than hair. Just think of food residues, hands running from the computer keyboard to the face and air pollution.
All this shows you how a beard, especially a long one, is an ideal place for germs and bacteria to thrive.