If you are coughing up thick green or yellow phlegm, or if you are wheezing, running a fever higher than 101 F, having night sweats, or coughing up blood, you need to see a doctor. These may be signs of a more serious illness that needs to be diagnosed and treated.