Skin tissue is not present in the lung. You are suffering from either a viral or bacterial infection. The slime that you coughed up is called expectorate, and is the excess mucus that your bronchi (tubes in the lungs) are producing. Expectorate can be transparent, white, yellow/green (if infected with bacteria). It is highly unlikely that your lung tissue has come out.
The rattling in your lungs is because of the excess mucus, again.
Do regular steaming to liquefy the mucus, drink lots of fluids, take rest, have nutritious food with less oil and spices. If the cough does not settle down, or your fever
goes up, consult your physician.
All the best!