Mucus is a substance that lines the inside of your bronchial tubes. Mucus helps trap dirt from the air you breathe in. Mucus comes out when you cough.