Groundwater contamination through potentially harmful metals (PHMs) is an environmental hazard in Pakistan with significant human health risk reports. The current research was conducted in Sheikhupura District, which is a major industrial site in Punjab, Pakistan. According to the Punjab Directorate of Industries in Pakistan, there are a total of 748 industries in this area. These industries produce a lot of waste and effluent, which contaminate the environment with harmful and toxic materials. Continuous irrigation with industrial effluent and sewage sludge may make groundwater sources vulnerable. Therefore, we collected 243 groundwater samples from community tube wells to investigate the groundwater quality cconcerning PHM contaminations in the study area. This research presents the values of pH, total dissolved solids (TDS), electrical conductivity (EC), and potentially harmful metals (PHMs) like arsenic (As), manganese (Mn), lead (Pb), zinc (Zn), copper (Cu), nickel (Ni), and iron (Fe). PHMs such as As (91%), Mn (14%), Pb (97%), Fe (45%), Zn (15%), in these samples were beyond the permitted limit recommended by the world health organization (WHO). Principal component analysis (PCA) results with total variability of (60%) reveal that the groundwater sources of the study area are contaminated about 30.9, 31.3, and 37.6% of contaminations of groundwater sources of this study are resulted from geogenic sources, anthropogenic sources, or both geogenic and anthropogenic sources, respectively. Such sources may include rock-water interaction, mining actions, agricultural practices, domestic sewage, and industrial effluent in the study area. Saturation indices show that the aquifers of the study area are saturated with lead hydroxide, zinc hydroxide, and goethite minerals, indicating that these minerals have a vital role in the contamination of groundwater. Health risk assessment results predicted that the non-carcinogenic risk (HQ) values of PHMs were found within the permissible limit (<1), except As (1.58E+00) for children, while carcinogenic risk (CR) values of all selected PHMs were lower than the maximum threshold CR value (1 × 10−4).