Constructing a confidence interval for a population mean

We build a confidence interval for a mean when we want to estimate some average in a population. For instance, what's the mean income in a country?We can't get data from everyone, so we take a sample and make an estimate using a confidence interval.