Once the team has been named and exchanged the players can not be replaced without the agreement of the other captain.
If the captain allows then the player can be a complete replacment and has no limits. This happens very infrequently.
More common is a substitute, a substitute can be approved by the umpires for any injury, worsening of existing injury or exceptional circumstances.
A substitute, may not bat, bowl or captain the team. In the 2017 laws it was changed to allow the substitute to keep wicket.
If a batsmen needs a substitute they can have a runner to run for them but this has to be a player who is nominated and they should have batted.
There has been a new playing condition added for international cricket that allows concussion replacements (https://www.timesnownews.com/sports/cricket/article/what-is-concussion-substitute-rule-heres-everything-on-iccs-new-set-of-guidelines/471184) first used for Steve Smith in the 2nd Ashes test 2019.