Just takes gaining some experience. The only thing I would complain about as far as stun are the few areas with multiple merc rocket enemies, since they ripple-fire. Off-hand, The Warlord is probably the mission where there are the most pairs of them along the paths where you are effectively funneled.
In the base game there really isn't much that will hit you if you are in cover at the same level as, or above the enemies. That includes rockets and flamethrowers. Of course, if the enemy is on top of you, they may hit you over cover. That means the position was untenable for whatever reason. Could just be it is a bad spot for the enemy location, or you didn't bring enough dps and cc to bear rapidly enough.
Merc Heavies / Geth Rocket Troopers - if you are in the open, strafing at the correct moment should allow you to dodge the rocket since they do not actually turn on a dime. The best way to deal with them is chain your squadmates powers against them since they are "instacast" if your squad is behind you (doesn't render their animations), and are hitscan. Of course care must be taken with their hitscan powers if you can't hardly see the target behind cover since it isn't difficult to order them to attack the cover. In any case a rapid Overload -> Pull chain will neutralize these guys as long as you have kept up with tech upgrades given that they all have "basic" shield strength.
YMIR - these mechs typically appear solo, although there are a few encounters where there are two at once. They go through essentially the same firing routine every single time, where they will attempt to suppress you with machinegun fire (their right arm), then they will fire a rocket (their left arm), then back to machinegun, then a single rocket. They telegraph when they are going to fire the rocket by stopping machinegun fire, and then aiming the rocket. In general the best way to engage this unit is to use "soft cover," which just means there is some obstacle between you and the target that they cannot shoot through. This allows you to change the angle between you and the mech when it swaps firing modes (and arms) so you can avoid both forms of damage. When it pauses in between modes, you can fire at it. Once you learn the rhythm and get the hang of soft cover, they are relatively simple to defeat one on one. The two mech encounters are basically just Blue Suns Base and Eye for an Eye, the latter of which you can cheese to kill the mechs before they even drop in.
Pyros - the whole point of this unit is to dramatically punish you for choosing a bad spot, or making ill-advised dashes in between areas of cover after you have allowed them to get in range. If Overload or Incinerate DOT hits these units on health, they should instantly explode. Also you can try to aim for their tanks. Generally you should try and prioritize them when they appear on the field so they can't get in range. The only time it is arguably unwise to engage as soon as you see them is Object Rho since killing them during the enemy spawn phase can cause another one to spawn in the wave. Most of the time they do not spawn near you, and you can see them in advance. The left tunnel in Archangel is about the only real exception since there is generally one around a corner that you can never see until you first peek around.