The basic rule for shooting at distance is, "If you can get closer, get closer. If you can get steadier, get steadier." For defense, we should add, "If you can get behind better cover, do so."
Be willing & prepared to brace against any solid object you can, or to drop down and go prone if you've got a decent place to do so safely.
That's always been my perception. Hard cover is good, hard cover that you can sight through with some concealment is better, all of the above and that you can lean on with arms braced, better than that.
In other words, to me, ideal would be something like a giant planter, full of sand, between you and the bad guy. It'd have foliage for some concealment that you could perhaps sight through, and would let you brace your arms against the edge for a lined-up steady shot and followups.