There are times when, for maintenance activity during business hours, we need to take a server out from the replica set, perform the maintenance, and put it back in the replica set. If the server to be worked upon is the primary, we somehow need to step down from the primary member position, conduct a re-election, and ensure that it doesn't get re-elected for a minimum given time frame. After the server becomes a secondary once the step down operation is successful, we can take it out of the replica set, perform the maintenance activity, and put it back in the replica set.
Refer to the Starting multiple instances as part of a replica set recipe in Chapter 1, Installing and Starting the MongoDB Server, for the prerequisites and to know about replica set basics. Set up a simple three-node replica set on your computer as mentioned in the recipe.