There is a lot of gas and dust in space. Most of it we can't see because both the dust and the background of space are very dark. Generally speaking, there are three different reasons we might get to see this dust. The Trifid Nebula (Messier 20) is a great showcase for this as it demonstrates all three in a single object. This also makes it an interesting object to try and image.