A runner is a player who is allowed to run between the wickets (to score runs) on behalf of a batter who is unable to do so. The batter must still face the delivery and hit the ball.
Whether a runner is allowed is up to the umpires. The specific threshold is that “the batter has sustained an injury that affects his/her ability to run and that this injury occurred during the match.” In other words, a batter with a pre-existing injury can’t start their innings with a runner.
Normally the runner should be a player who has already batted in the innings. The only normal exceptions would be if the injured batter is part of the opening pair and nobody has been dismissed themselves, or if any dismissed batters are themselves injured. In this case somebody yet to bat can act as a runner, but only until somebody else is available (eg the other opening batter getting out.)
The runner must take up a specific position. When the batter is on strike (receiving deliveries), the runner must stand on the popping crease but away from the wicket. This is possible because the popping crease is always treated as running all the way to the boundary, extending the marked line. If the runner attempts a run, they must reach any point on this imaginary crease. (The same technically applies to any batter, though they don’t usually have reason to go wider than the marked line.)
When the batter is not on strike, they must stand where directed by the umpires remain there until they are on strike again. Normally they’ll be told to stand by the square leg umpire, which can be confusing for spectators as they will start the delivery at the same end as the other batter. The runner will take up the normal position of a batter who is not on strike.
The runner must wear the normal clothing and protective equipment of a batter and must carry a bat. They must complete a run in the normal way by touching the ground beyond the crease with either their body or the bat.
In principle, the batter using the runner does everything the same as normal and can be dismissed in the usual ways. The only difference is that it’s the runner who must complete the runs and faces the risk of a run out. (This would count as the dismissal of the batter.) The batter’s position wouldn’t matter in this situation. It’s also possible for the batter to be stumped (and thus dismissed) if the runner is in front of the crease, even if the batter is behind their crease.
Although the Laws of Cricket cover how using a runner operates, the playing conditions of a tournament can ban runners completely (even when a batter is injured.) Since 2011, all international matches and tournaments overseen by the International Cricket Council ban the use of runners. This has led to some memorable moments including Nathan Lyons hobbling to complete runs with a torn calf in an Ashes test match and Glenn Maxwell scoring 201 in a World Cup match despite having to concentrate on boundaries as back spasms made it extremely difficult to run between the wickets.