The classic example is the plane, which is not compact. Curl it up into a sphere with a hole at the top, then add the point at infinity, which becomes the north pole, and closes up the sphere. The sphere is compact, hence it is the "compactification" of the plane.
In this case we have a precise map. Place the sphere on the xy plane, its south pole at the origin. Draw a line from the north pole, through the surface of the sphere, and out to a point in the plane. These rays implement the bijection between the punctured sphere and the plane. You can derive the formula and prove it is bicontinuous. Thus the plane and the punctured sphere are homeomorphic.
The north pole does not map to any point in the plane; it is the point at infinity. It is also the key to making the sphere compact.
Enough of our illustrative example, let's define compactification.
Let S be a space that is hausdorff and locally compact. Add the point ω to S. Open sets in S remain open. Also, the complement of a compact set in S, which necessarily contains ω, is open. We need to show this is a valid base for the topology, and there are no new open sets in S.
The intersection of two open sets in S yields an open set in S, so that's not a problem.
Intersect an open set in S and the complement of a compact set in S. Since S is hausdorff, compact sets are closed. Thus we are intersecting two open sets in S, and the result is open in S.
The intersection of the complements of two compact sets is the complement of their union, which is another compact set. In every case, the intersection of open sets is open, so we have a base.
If even one open set in a union of open sets contains ω, the union contains ω, and isn't going to make any unwanted open sets in S.
If x and y are in S they can be placed in disjoint open sets in S. Given x and ω, find an open set about x whose closure is compact, and let the complement of the closure contain ω. Thus any two points in C can be separated in disjoint open sets, and C is hausdorff.
Now for compactness. Start with an open cover for C. Let O be an open set that covers ω. The complement of O is compact, and a finite subcover will do. Bring O back in and find a finite subcover for C. Thus C is compact.
If S and T are homeomorphic, verify that their compactifications are homeomorphic. Apply the preexisting homeomorphism between S and T, and map ωS to ωT. The new open sets correspond, and the compactifications are homeomorphic.
Select any x in O, and since R is compact, we can separate R and x in disjoint open sets. Let U be the set about x. The closure of U is in O, and since it is closed in S, it is compact. This makes O a locally compact space. And of course, O remains hausdorff.
Let C be the compactification of O. Now O in S is homeomorphic to O in C. Map S onto C by mapping O to O, and R to ω. This crunches R down to a single point ω. Verify that this map is continuous.