Rangers with Beast Master archetype can select the following option.
Ranger’s Enhanced Companion
3rd-level Beast Master feature, which requires the Ranger’s Companion feature
Add your proficiency bonus to your companion’s Strength and Wisdom saving throws if it doesn’t have saving throw proficiencies.
It has a hit point maximum equal to the number listed in its stat block or the value from the Beast Master Companion Hit Points table. It gains a number of Hit Dice equal to your ranger level that can be spent to heal itself during a short rest. The size of its HD is indicated on the Beast Master Companion Hit Points table.
You can select a beast of Medium size or smaller, or one which can serve as a mount that is one size larger than a normal member of your race. A beast with a flying speed can only accept a rider that is at least two sizes smaller that it (for instance, a Medium companion can only be mounted by a Tiny ranger).
You can command your beast by taking a bonus action. If you mount your companion beast, you can only command it to take the Dash, Disengage, or Dodge actions. If the companion acts as an uncontrolled mount, it can move, but will only take the Dodge action.
Your companion gains the benefits on ability checks from your Favored Terrain feature and against your foes from your Favored Enemy feature. It also benefits from your Foe Slayer feature. If you take the Favored Foe feature, you can have your beast’s attacks benefit from the feature instead of your own.
Beast Master Companion Hit Points
|Type||Hit Points||HD Size|
|No flying speed||5 + 5 times your ranger level||d8|
|Flying speed||4 + 4 times your ranger level||d6|
The DM can provide support in changing the statistics of a beast so that is has a CR of 1/4 and can be selected as a companion beast. Often this requires reducing the damage die, Strength or Constitution scores, or removing multiattack. This option enables the ranger to have a beast companion beyond the normal range presented in the Player’s Handbook and this supplement.