How? The usual approach is to have multiple parallel organisations all watching each other with their guns loaded and safeties off. That doesn’t work so well in countries with complex tribalism and very limited education. You have to either have ‘family’ you trust and accept most of them are illiterate or pick people for competence and accept they will be looking out for their ‘family’ above you. Or just spend a giant chunk of your money on foreign mercenaries.You could coup-proof the military
None of these options foster an ideal environment for rapid industrialisation, and all of them have plenty of scope for someone farting wrong and triggering a civil war followed by the Samuel Doe outcome.