Ground water is almost every where, then how do mines and other holes are digged so that ground water doesn't drain into it
We pump it out. Open and closed pit mines usually have pumping installations to get the water out.

Look up Mine dewatering on Wikipedia.

There have also been numerous accidents in the past where mines were flooded (YouTube: Turkey mining accident: 18 workers trapped after underground water floods mine), and when left alone many abandoned mines will fill up with (ground) water.
Sometimes these are nice diving objects.

Or (as Trond Hansen commented) we try to prevent it from coming in in the first place, by using cement, grout or bulkheads to 'plug the holes'.

If you are really interested:

Mine Water: Hydrology, Pollution, Remediation by P.L. Younger, S.A. Banwart, R.S. Hedin.

Design of Water Holding Bulkheads for CoalMines by V.S. Mutton and A.M. Rememnikov