A Bodyguard is a role who can target a player at Night to protect them. However, if the protected player is supposed to be killed, the Bodyguard is killed instead ("taking the bullet" for them, as it were).
Bodyguard only protects from a single kill. If multiple people try to kill the Bodyguard's target, both the Bodyguard and the protected player will die.
Bodyguard is usually Town. It makes little sense for there to be a Mafia Bodyguard, as they have no reason to target anyone except a scumpartner; and a Vigilante who finds that their kill resolved on a different scum than they expected can simply shoot their previous target again.
Elite Bodyguard is a variant that will also kill the person who performed the kill, in effect acting as a Bomb in addition to a Bodyguard. This version of the role is significantly stronger than the original, and should be balanced as stronger than a Bomb.
Some moderators in the past used Bodyguard and Doctor interchangeably.
A variant on Bodyguard that is occasionally seen is a Percentage Role: If the person they protect is supposed to be killed, 50% of the time the Bodyguard will stop the kill and learn who the attempted killer was; 50% of the time they will function as in the original definition. This role is both swingy and potentially overpowered, and is not recommended if it can be helped.
A Bodyguard that protects their target from one kill is considered Normal on mafiascum.net. A Bodyguard cannot stop a Strongman from committing a kill, nor a Weak role from dying due to targeting anti-town. Protection would also fail if targeting a Macho or Ascetic role, although the Bodyguard should not be told if this happens, just like if they were blocked.
Use and Power
As a protective role, Bodyguard is essentially a weakened Doctor. Not only can it only successfully protect once, but it also does not technically stop the kill from going through. The only benefit from a successful protection is essentially a redirection of the kill from someone who is presumably more valuable to keep alive. In games where protection is desirable but a full Doctor could lead to overpowered role combinations, Bodyguard is a decent consideration.
As always, including multiple protective roles in the game can lead to broken role combinations. Doctor+Bodyguard can lead to circular protections, as can Bodyguard+Bodyguard. If you are going to include these combinations in your game, make sure you specify how they work - presumably in a way that does not allow them to cross-protect successfully.