By the 2014 and 2024 D&D rules as written, if you have the War Caster feat, and the spell has no material components, then no need to have a focus in hand when you do so, as you can perform the somatic components when you have your hands full with weapons and/or shield.
You are correct that if the spell has a material focus, that you either need a hand free, or to have the focus in hand to do so as a reaction, as you cannot perform sheathe your weapon as a free object interaction as it is not your turn.
If you're fighting with a two-handed weapon, presumably you can also relax to a one-handed grip to cast a spell with a material component as a reaction with the War Caster feat.
The spells
Booming Blade,
Green Flame-Blade, and
Steel Wind Strike are an exception to this free hand requirement for a two-weapon fighter or weapon-and-shield user, as the material component is the weapon, so you have it in hand already and hence can cast the spell as a reaction with the War Caster feat.