I use a hybrid approach...
OptA) using a group of archers as example, they fight / act as a "unit"... so "in general", if they're being breached by soldiers away from the main fight, they'll, as a unit, switch to swords & repel / defend / flee and as a group take the "proper action sequence" as the PCs would do. This "keeps it simple", but at the same time the PCs don't think you're "cheating". As a new DM, I strongly recommend you don't let your PCs think you're "cheating", as it'll remove their suspension of disbelief (even if you are. 🙃)
OptB) for solo / small group / featured NPC's, they fight / act just like PC's, so they will always take the "proper action sequence" as the PCs would do.
As an aside, esp for beginning DM's, I would encourage you to "personalize" the monsters & how their "action switching" occurs from a "cinematic" perspective (even for 'natural' abilities, if interesting)... For instance, I like the cinematic aspect of Dragon taking time to 'inhale' for a large bout of Dragon breath; so 'most' Dragons work differently for me... I essentially treat Dragon's breath like the old heavy crossbow, where they'd spend an entire round 'gathering breath / energy' before a 'full' breath weapon attack. And in order to keep the Adventurers guessing, they can use a 'half' breath weapon attack with no delay, & some Dragons have the 'feat' Quick Breath, allowing them to do either 3/4 or a Full breath (depending on their Age category) with no delay.
This delay for ... "powering up / transitioning / etc" ... builds tension & allows the Adventurers to become more invested in the outcome vs a straight "the Dragon Breathes on you" ... and by allowing for this, it allows the Adventures to "Avengers Unite" and develop a quick plan to try to stop the "giant weapon" from deploying (or at least mitigate/minimize the damage). After all, imagine how different Star Wars would have been if the Death Star didn't have to charge, but just shot... all the tension would have been gone. Finally, you can do this for the good guys too, think SDF-1 from Robotech.