A city wants to know what share of its 400,000 voters support building a new park. It cannot ask all of them, so a polling company phones 1,000 randomly chosen voters, and 540 say yes. The 400,000 voters are the population: everyone the question is about. The 1,000 are the sample: the part actually asked. The sample's 54% is used as an estimate of the city's true percentage.
How the sample is chosen matters more than how big it is. If the company only asked people at a park festival, even 5,000 answers would overcount supporters. Random selection gives every voter the same chance of being picked, so the sample tends to look like the population. Even then the estimate is usually a little off: a different 1,000 voters might give 52% or 56%.
Not every data set is a sample. If a teacher records the score of every student in her class and only wants to describe that class, she has measured the whole population; that is a census, and her average is exact. The same 28 scores become a sample if she uses them to describe all seventh graders in the country. So look at the question: who is the claim about, and was everyone in that group measured?
Think of it like this. A population and a sample are a pot of soup and one spoonful. If the pot is stirred well, one spoonful tells you how the whole pot tastes. Skip the stirring and the spoonful can mislead you, just as a sample that is not chosen at random can misrepresent the population.
Core idea. A population is every member you want a conclusion about; a sample is the smaller subset you actually measure to stand in for it.