Given the following question:
The principal wants to estimate the percentage of students in the school who play video games, which is a good number of students. Selecting 30 random students and asking them if they play video games can represent the entire school. Asking 30 random students keeps it from being biased for example option B, asking 30 students who take coding classes is biased because they are in one specific class, they do not represent the majority of the school unless the school is a coding school.
The answer is the first option because it is a random sample of people to represent a population of people. This keeps the results from being biased so asking 30 random students is the way to go.