This could probably leverage the Level Up rules in general for instance its companion rules (which has a bodyguard) and maneuver system you can get as the foundation allowing your battle squire to perform attack blocks without being killed.
Can it occur off turn?
So, here are some concrete mechanics.
Melee:
Melee Characters have a Melee DC equal to 8 + Proficiency bonus + Strength modifier, and a melee threat. A typical character has a melee threat equal to their weapon damage plus their strength modifier, but at higher levels this is increased.
When you start your turn in melee range of a hostile creature or attempt to leave it at any time, you have to make an Armor (or Defence) save against their Melee DC. If you fail, you take damage equal to their melee threat.
Fighter's melee threat is equal to weapon damage dice plus strength at level 1, and gains another set of weapon damage dice at level 5, 11 and 20.
Paladin's melee threat is equal to weapon damage dice plus strength at level 1, and gains another set of weapon damage dice at level 5. At level 11, it gains 1d8 radiant damage.
---
Actions in Combat:
Ranged Weapon Attack: TODO
Disengage: You don't have to make an Armor save if you leave melee range this turn.
Defend: You gain advantage on Armor saves.
Disrupt: If successful, the enemy has disadvantage on Armor saves.
and some more.