Water finds it way to the lowest point because of gravity. So if we dig a mine or something same, then how we take ground water in account, so that it doesn't fill in.
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