Most candidates are not sure how to answer this question. The interviewer is testing your salary requirements against the range they have for the position. If you are outside of the range, then you might not be worth pursuing.
What is the best approach to answer this question?
Generally, the person who throws out a number first loses. Instead of giving a number try to turn the question around with a question. If the interviewer presses for a number, give a broad range for the role. You can look on Glassdoor at salaries, but they are not always accurate.
For an entry level candidate, you can ask what the typical salary range is for entry level candidates with similar experience is, or you can say a salary commensurate with the job.
For experience candidates, you can ask the same question, or share that in your research you found the market rate for this role is $XX,000.