Typically wheezing that comes with a cold or upper respiratory infection will go away when you start feeling better (per Houston Methodist Hospital). If you suddenly notice wheezing that isn't caused by allergies or asthma, your doctor might need to check your lungs particularly if it persists for a while. What also might be concerning is if you've had heavy wheezing and it suddenly stops. This could indicate a total blockage of the airflow in your lungs. A breathing test can determine if you have an obstruction in your airway.
You should head to the emergency room if your wheezing is accompanied by bluish skin or fingernails (via Cleveland Clinic). That's because whatever is obstructing your airflow is preventing oxygen from getting into your lungs. People who are allergic to bee stings might need to seek emergency care if they begin wheezing. An ER visit might also be necessary if you begin wheezing after eating (or choking on) certain foods or taking a new prescription medication.