The mentioned method is particularly useful when, let’s say you want to make the changes to the project template which has a large WBS structure, and a lot of role assignments to tasks.
Access the project’s Task > Assignments page
Using the Assigned To filter option, select the role that needs to be replaced
Select the checkbox on the label section of the list view, and click on Replace
On the corresponding window, select the role that needs to replace the existing one, and click Replace
The existing role will be replaced by the new role on the tasks that were assigned to the old role
I've attached the pdf for the same for reference.