If we had a class of 200 people and we made a survey in which anyone in the class can choose to participate or not, does this count as random sampling?
I feel like it's not, but I can't put it into words why it is not.
It is not random sampling, because people have a free and possibly biased choice, or reason, to not participate. Put differently, the people opting-in are possibly different (in relevant characteristics) from those opting-out.
See also Wikipedia: self-selection bias.