It's true that James Webb carries fuel, and you're right that it is not used for positioning, at least not directly (see below). Fuel is used for maintaining its orbit around L2, and was also used three times on its journey to L2, as "corrections burns". Note that the distance to the target is irrelevant. A nearby exoplanet and a distant galaxy are both "infinitely far away" for observing purposes (although of course in general more distant object are fainter).
To acquire a target, James Webb (and other space telescopes) uses a number of reaction wheels, one for each "axis". At least three are needed, but James Webb has six; more allows for easier control, but are also heavier. These wheels rotate constantly, thus storing a large amount of angular momentum to keep the telescope steady. Changing the angular speed of one of the action wheels causes Webb to change its direction along that wheel's axis.
Edit thanks to @KarlKastor: While James Webb observes, the photon pressure of the Sun's light exerts a torque on the telescope. To maintain its position, this is counteracted by adjusting the spin of the reaction wheels. This causes angular momentum to build up, which must occasionally be dumped by firings Webb's thrusters once per week or so (JWST Momentum Management).
Additionally, Webb has six gyroscopes which tell the telescope which direction it's currently pointing, and how fast it's turning. Unlike Hubble's gyroscopes, however, which are mechanical, Webb uses Hemispherical Resonator Gyroscopes, which have no moving parts susceptible to wear, instead measuring the precession of vibration patterns in a crystal.
Finally, to ensure a perfect pointing, one of Webb's four instruments, NIRISS, is equipped with a "Fine Guidance Sensor" which "locks" the telescope on a target by observing the exact position of a star in its field of view.
Edit thanks to @David Hammen: In addition to the Fine Guidance Sensor, the JWST also has a few regular star trackers.
To power its various moving parts, James Webb has its solar array, capable of providing 2 kW, twice the needed amount.
You can read more about the positioning system at the NASA FAQ.