How do we stabilise satellites so precisely? Look at the Hubble Ultra Deep Field photo. The stars in it are on the order of 1 arcsecond across. To an order of magnitude, this is $10^{-6}$ radians in a $10\text m$ telescope which was held steady for $10^6$ seconds.
In other words, the velocity of the aperture of the telescope around the light sensors had to be on the order of one angstrom per second.
Perhaps my maths is wrong, but this seems like an extraordinary feat of control. I can't quite believe it. The computer programmer in me suspects that, since the image was captured across a number of occasions, each occasion would be smeared somewhat less than a single long exposure and some kind of correspondence-finding algorithm could alight the images (and infer the drift of the telescope). In any case, even if that is what they did, the satellite is held amazingly steady.
How do we achieve this?
 A: Actually reaction wheels or control moment gyros are only part of the answer. To maintain the the accuracy and precision on the order of what Hubble demands requires a fully integrated Feedback Control System of actuators and sensors. For microradian pointing, reaction wheels provide only the first stage of isolating disturbances in a multi-stage pointing control system. 
Disturbances that can interfere with attitude stabilization include those from outside the spacecraft, such magnetic anomalies and atmospheric drag from planetary orbits, or solar winds from spacecraft further away from a planet - as examples. Or disturbance can come from the spacecraft itself such as vibrational modes excited by solar array stepping.
Reaction wheels or CMG's can be used to change the attitude of the spacecraft, and together with feedback from gyros or inertial measurement units (IMU's) closed loop control systems maintain the attitude to perhaps 10's of microradians in the face of the disturbances.
But to get down to microradian or submicroradian stability usually requires optical components in the line of sight that compensate for the residual higher frequency jitter that the reaction wheel control system is unable to remove. A fast steering mirror for example can be tipped or tilted to re-align the optical path according to what the imaging sensor reads from the target star or galaxy.
A: They use reaction wheels, which are a type of flywheel to stabilize many spacecraft.  For missions that need to be extremely stable (i.e., any mission with telescopes like Hubble), they try to avoid using the thrusters as these cause small vibrations to "ring" throughout the spacecraft.  The vibrations can last for relatively long periods of time on some spacecraft due to their design.
Edit
I should add that reaction wheels are generally made of ferromagnetic (or slightly magnetic) materials for various reasons.  Unfortunately, this causes a lot of problems for a spacecraft that needs to measure electromagnetic fields, as a rotating magnetic produces huge fields compared to, say, the solar wind.  Hubble, thankfully, only cares about incident light which really should not care about the small fields produced by these wheels.  The new mission, Solar Probe Plus, does care about magnetic cleanliness so they are working on dealing with the induced fields from the reaction wheels.
Edit: 2
For small spacecraft, for instance CubeSats, that do not care about absolute precision in their attitude control, they can use magnetic torque from the Earth's magnetic field to align an axis of a large magnet within the spacecraft body.  This can be useful for CubeSats that have a particle detector that wishes to remain looking along the background magnetic field.
Some spacecraft, like Wind, have star sensors in addition to a sun sensor.  These systems are used to help maintain the desired pointing direction of a spacecraft.  In the case of Wind, the flight operations team use the star and sun sensors to keep the spin axis within $<$ $1^{\circ}$ of the south ecliptic pole.  The angular momentum supplied by the long wire antenna help to maintain a very stable pointing axis.
Edit: 3
@PaulEGCopeBScARCSFBIS made a useful suggestion regarding the EXOSAT mission, which used a combination of gyros and thrusters to refine its attitude control.  The following from White and Peacock, [1988] summarizes the spacecraft's capabilities:

A propane cold-gas thruster system was used for both slew manoeuvres and fine pointing.  The attitude was controlled using one of two star trackers (with each attached to a low energy telescope), three gyros and a sun sensor and could be maintained to within ~1 arc second.  The star trackers required at least one star (but preferably two for the most accurate attitude reconstruction) brighter than eighth magnitude within its 3° square field of view.

So as Paul mentioned, I should not have dismissed thruster controls so quickly.  The downside with thrusters is that it limits their lifespan and can introduce a cloud of neutral particles, which quickly ionize, and can corrupt particle and fields measurements.
References
White, N.E. and A. Peacock "The EXOSAT observatory," Mem. S. A. It. 59, pp. 7-31, 1988.
A: Three capabilities are needed to precisely control of the orientation of high precision spacecraft such as the Hubble. The spacecraft must have


*

*A notion of where it is supposed to be pointing,

*Equipment that can detect the spacecraft's attitude and attitude rate,

*Equipment that change the spacecraft's attitude and attitude rate,

*A control system that guides the spacecraft toward a state that is close to the desired state.


Solving this problem is the subject of spacecraft attitude guidance, navigation, and control. The problem is unsolvable if any one of those pieces is missing. This turns out to be a very complex subject. The keys to the puzzle are items #2 and 3. Step #1, knowing where to point is simple: It's a command from the ground. Step #4, correcting the error is a well known but complex subject (you need a masters degree, minimum). Getting from step #1 to step #4: That's difficult. The spacecraft needs to be able to measure deviations from nominal (step #2) and the ability to correct those deviations (step #3).
