In the USA, this question is irrelevant because US law requires civilian control of the US military. The US Constitution was written this way to incorporate the balance of powers. It’s a balance because while the President is the commander in chief, only the Congress has the power to declare war and fund the military.
And, the President has many military commanders and defense department experts with plenty of military experience to help him. In other countries, when the commander in chief comes from within the military, that country is typically a dictatorship or an autocracy. Examples of military commanders in chief include Saddam Hussein and Idi Amin.