I present the observational and numerical results of my phd thesis developed in the past three years. These results account for high-quality X-ray observations of diffuse X-ray emission in Wolf-Rayet nebulae and planetary nebulae (PNe) in comparison with optical and infrared observations. Our numerical simulations were tailored to study the formation, evolution, and X-ray emission from PNe. These results help us study the role of instabilities in the creation of clumps and filaments to reduce the temperature of the hot bubble to observable values.