In many sports a player can come out of the game, rest for a while, then re-enter at any time they want to. Baseball isn’t like that. Once a player exits the game, they’re done for the day.
Any player can be replaced at any point—in the field, while on base, or during at-bat (although generally it would be before the at-bat).
Once in the field players can move around or switch positions at any point, they cannot however move up or down in the batting order.
In the occasion a manager (that’s a coach in baseball) wants to remove a player from a certain spot in the order he can do this via a double switch.
A double switch brings two new players into the game (thus removing two) who play a different position than the player they are replacing. Usually this move is executed to avoid having a pitcher hit. The video should make more sense than me trying to write it out: