Instructions
Detect cloaked units with the naked eye simply by watching the screen carefully for the telltale visual ripple generated by cloak fields. This lets you know that a cloaked unit exists and where it is, but it won't allow you to target the unit with standard weapons or abilities.
Bring a unit with the Detector ability within visual range of the cloaked unit. The Protoss Observer, Terran Raven, and Zerg Overseer can all detect cloaked units, as can the stationary Terran Missile Turret, Protoss Photon Cannon and Zerg Spore Crawler. If one of these units or buildings is within range, all your units will be able to see and fire upon the cloaked enemy.
Use an ability that shuts down cloak fields to reveal the unit without a Detector. The Terrans can use an Orbital Command Center to perform a long-distance Scanner Sweep or a Ghost to fire a close-range EMP round; both of these temporarily reveal cloaked units. The Zerg Infestor's Fungal Growth has the same effect. Because these are all area-affecting abilities cast on a portion of the battlefield, your units aren't hobbled by your inability to directly target a cloaked unit.