Quick scoping in Team Fortress 2 comes down to speed and timing, mostly with the Sniper's rifle.
The basic sequence is:
The whole motion needs to happen fast—the idea is to aim and shoot in one fluid movement before you fully settle. Be warned, though: it's a tricky technique and you'll probably miss a lot while you're learning. Practice makes it more consistent.