How does ‘they(plural)’ replace with singular’(he/she)’ in a sentence? Example: If he or she doesn’t want to do it then it’s their wish.
In this case, they is a gender-neutral pronoun. It's called singular they. It can be used when you don't know the gender of the person you are talking about. It can be used in any position in a sentence.
A journalist should not be forced to reveal their sources.
If Sally or George got a cold, I would have sympathy for them.
Each student submitted their art portfolio to the committee.
Note that grammatically, it's still treated as a plural pronoun, so it always takes a plural verb.
Every individual is unique. They are a combination of strengths and weaknesses.
Every student has what they need to succeed.
The only difference between the singular they and the normal plural they is that the former has two self forms, themselves and themself.
In recent years, people have started to use themself to correspond to this singular use of they and them: it’s seen as the logical singular form of themselves. For example:
This is the first step in helping someone to help themself.
This form is not yet widely accepted, though, so you should avoid using it in formal written contexts. If you were writing the sentence above, you should say:
This is the first step in helping someone to help themselves.