Environmental pollution has emerged as a critical global challenge, significantly affecting various aspects of human life, including food security. This research paper investigates the effects of environmental pollution on agricultural output (a proxy for food security) in Malaysia from 1990 to 2020, utilising the Autoregressive Distributed Lag (ARDL) method. The results obtained from the bounds cointegration testing approach provided strong evidence supporting the existence of a long-term relationship among Methane emissions in the energy sector (thousand metric tons of CO2 equivalent) (CH4), Carbon dioxide emissions (metric tons per capita) (CO2), Nitrous oxide emissions in the energy sector (thousand metric tons of CO2 equivalent) (N2O), GDP, population, index of agricultural total factor productivity, and agricultural output. Estimation of long-run and short-run ARDL with diagnostic and model stability reveals that there is a positive correlation between the index of agricultural total factor productivity (TFP) and agricultural output in Malaysia in all four of the models analysed. The discoveries illuminate the possible mechanisms by which environmental pollution affects food security in Malaysia, offering valuable insights to policymakers and stakeholders for crafting effective strategies toward sustainable development. By uncovering the implications of environmental degradation on food availability, access, and nutritional quality, the study highlights the urgency of addressing environmental challenges to ensure long-term food security for the Malaysian population. Moreover, the study can serve as a basis for formulating sustainable policies that promote resource conservation, waste management, and eco-friendly practices in the agricultural and industrial sectors, fostering a harmonious coexistence between economic development and environmental preservation.