A selection bias occurs when the people who are research participants are selected in a way that does not make them representative of the population that the study wants the results to apply to. This type of research bias occurs during the selection phase of the study where the participants are being recruited and can cause issues with internal validity.
Let's say an experimenter wants to know how important eating healthy food is for New York City residents. The researcher takes their survey to health food stores, vegetable stands, and gyms. The results show that eating healthy is extremely important to the majority of people who live in NYC.
What is wrong with this experimental design? The researcher went to typical places where the patrons would be into healthy eating. For the sample to be representative of NYC residents they would need to go to places like regular grocery stores and businesses not geared towards health. This makes the sample more likely to be representative of the population. Selection biases are common in online surveys. The results need to be closely examined because the people taking the survey (the sample) are people who visited the website. Surveys don't take into account people who never saw the survey.