Role prompting means opening with an identity: you are a paediatric nurse, or a sceptical code reviewer.
The mechanism is unglamorous and worth understanding, because it sets expectations correctly.
The model has read enormous amounts of text written by many kinds of people for many audiences.
A role is a strong hint about which of those regions the continuation should resemble.
So the vocabulary shifts, the level of hedging shifts, and the assumed background of the reader shifts.
That is genuinely useful when the same information needs different framing for different readers.
What a role does not do is add knowledge, and this is the most common misunderstanding.
Telling a model it is a cardiologist does not give it any medical fact it did not already contain.
It can even hurt, by making an uncertain answer sound more authoritative than the evidence supports.
Specific descriptions outperform impressive titles in almost every comparison worth trusting.
Explaining this to a nervous first-time patient steers better than declaring the model a world expert.
Roles are also a convenient way to set length, formality and structure without listing rules.
In a chat application the role belongs in the system prompt, so it persists across turns.
Treat it as one lever among several, below clear instructions and good examples in importance.
And check the output, because a confident persona is exactly what makes a wrong answer persuasive.