How do we track the exact location of the spacecraft which is millions or billions of miles away from us? What things do we study for tracking purpose? How exactly do we predict?
How do we track the exact location of the spacecraft which is millions or billions of miles away from us?
We don't track the exact location of spacecraft. There are always errors in measurements, errors in the behaviors of the spacecraft when it makes maneuvers, and errors in our models of the solar system. Exactness (perfection) is unattainable. It is far better to model those errors than it is to pretend they don't exist.
What things do we study for tracking purpose?
This depends very much on the object of interest. A key distinction is whether the object of interest is a cooperative or uncooperative target. A cooperative target somehow actively cooperates in determining the object's trajectory. The Moon, the Sun, the planets, asteroids, etc., are obviously uncooperative. All objects of interest in space were uncooperative until the middle of the 20th century, and the only available measurements were the object's angular position (azimuth and elevation) as seen by an observer on the surface of the Earth.
This changed drastically in the latter half of the 20th century when humanity developed radar and when humanity started sending cooperative targets into space. Radar enables the measurement of the range to somewhat nearby objects in space, where "somewhat nearby" means a few astronomical units or so. These range measurements alone are quite precise, enough so that direction measurements (azimuth and elevation) are of lesser importance.
Cooperative targets that relay a signal sent from the Earth back to the Earth drastically improve the range of this already very precise range measurement and enable an even more precise measurement, range rate (the rate at which the distance to the target changes with respect to time).
With one exception, measurements of where a cooperative target is in the sky are so imprecise compared to range and range rate that those measurements are essentially useless. That one exception is Delta-Differential One Way Ranging, or ΔDOR, for short. This involves simultaneous observations of a deep space probe by two or more ground stations separated by thousands of kilometers. Interferometric techniques yields nanoradian level precision on the angular position of the observed object.
How exactly do we predict?
Even with range, range rate, and ΔDOR measurements, a single set of measurements provides information on only four measurements of an object's state. Moreover, because ΔDOR requires using two ground stations simultaneously, it is rather expensive. In many cases, there are only one (range) or two observations (range and range rate) at any point in time. Whether it's one, two, or four measurements, that's does not suffice because an object in space has six translational degrees of freedom. Inferring orbital state from a single set of measurements is an underdetermined problem.
What's done is combine multiple sets of measurements gathered over time. This is an overdetermined problem. Each of those measurements has an error associated with it, the propagation from one measurement to another induces additional errors (process noise), and imprecise behaviors of a probe when it performs a correction burn or adjusts its attitude induce yet other errors (plant noise).
Describing the techniques needed to combine those multiple measurements and to account for measurement noise, process noise, and plant noise would require multiple books. If you want to study this on your own, you'll need to understand statistical filtering techniques. One set of keywords of interest is "precision orbit determination", or POD for short.
While this site does not give a very detailed answer, it gives a relatively good idea on how this is achieved:
The JPL has five groups, that handle the navigation together.
Calculates the positions of astronomical objects at predicted times.
Orbit Determination Analysts
Study radio transmissions and images from cameras to determine the spacecraft’s current location.
Plan propulsive maneuvers to keep the spacecraft on the correct flight path.
Radiometric Tracking Team
Assesses techniques for acquiring and improving the accuracy of radio-based measurements of the spacecraft’s velocity, location, and angle relative to Earth.
Plot the most efficient path for the spacecraft.
So it really is a team effort involving large groups of experts employing several different methods to locate a satellite.