During the coal mining process, a large amount of waste such as coal gangue and coal washing water is generated. The heavy metal pollutants in those wastes migrate and diffuse into the surrounding soil and water environment through sedimentation, runoff, leaching and other processes, posing a threat to the ecological environment. In order to study the heavy metal pollution in an abandoned coal mine area and to evaluate its ecological hazard risk, the contents of Cu, Pb, Zn, As, Cr, Ni, Hg, Cd elements in the coal gangue, water and soil samples of the mining area were detected. The single factor index method and potential ecological hazard index method were used to analyze the heavy metal pollution and its potential ecological hazard risk. The heavy metal pollution in the soil downstream of the coal washing plant in the mining area was mainly studied. The improved BCR continuous extraction method was used to analyze the forms of heavy metal elements (Cu, Zn, Cd) in the soil samples and the risk assessment coding method was employed to evaluate the bioavailability and environmental risks of heavy metal elements. The results show that: ① on average, the heavy metal contents in the coal gangue of the coal mine area are relatively low, with only Cr element content being slightly higher than that in soil. Moreover, the heavy metal element contents in the coal gangue do not exceed the risk intervention values for the soil of agricultural land, which has a little impact on heavy metal pollution in the soil. ② The heavy metal contents in the mine area’ exceed the standard, including that of Cu, Zn, Cd, Ni and As elements, and the Cd pollution is relatively serious. The pollution areas of Cu, Zn, and Ni elements are mainly concentrated in the western and southeastern parts of the gangue hill, with a certain overlap in spatial distribution. The As element pollution is distributed in the northeastern part of the gangue hill, while the Cd element pollution is widely distributed in the mine area, with moderate to severe pollution. ③ The Cd and Hg elements have potential ecological hazard risk, with a higher risk for Cd element. The comprehensive potential ecological hazard risk (RI) of heavy metal elements is mainly moderate to strong. ④ The contents of heavy metal elements in the soil downstream of the coal washing plant show an overall decreasing trend along the water flow direction, with the Cd element pollution being more severe, and the Cu, Zn, Ni, As element pollution concentrated within 200 m downstream of the coal washing plant. The heavy metal element contents of the profile sample shows a decreasing trend in the vertical direction, with no accumulation in the vertical direction. ⑤ The groundwater quality in the mine area is good, and the pH and the contents of heavy metal elements in the mine water meet the limit values of Class III surface water quality standards. The discharge of mine water drainage has a little impact on heavy metal pollution in the soil. ⑥ The proportions of acid extractable Cu and Zn elements are low, with low bioavailability, while that of Cd element is high, presenting a high-extremely high risk, with strong bioavailability and high environmental risk. Based on the current situation of heavy metal pollution in the mining area, it is recommended to further strengthen the prevention and control of heavy metal pollution, strengthen the source control, monitoring of agricultural food safety, and the investigation and research on the Cd element pollution.