Here is a very large website dedicated to the evergreen, undying question: Could the Empire destroy the Federation? It is made interesting by the fact the author apparently has some brains and some knowledge of engineering and physics. Star Trek does not get off easily.
Anyway, his site verifies something I noticed: Star Trek never did the “military” thing very well, the Federation would be wiped out totally within months if not weeks of coming across a real enemy, and the tactics used by Federation forces would be grounds for a drumhead tribunal followed by summary execution if any real-world CO dared emulate them. In particular relative to this thread, the Federation doesn’t have a credible array of firearms, no grenades (other than the highly unpredictable failure mode of the phaser), no artillery, no good troop transports, and certainly no infantry tactics or doctrine. (“Suppressing fire” and “cover” must be outlawed concepts.)