Background: K40 plays a significant role in the radiogenic heating of Earth-like exoplanets, which can affect the development of a habitable environment on their surfaces. The initial amount of K40 in the interior of these planets depends on the composition of the interstellar clouds from which they formed. Within this context, nuclear reactions that regulate the production of K40 during stellar evolution can play a critical role. Purpose: In this study, we constrain for the first time the astrophysical reaction rate of K40(n,p)Ar40, which is responsible for the destruction of K40 during stellar nucleosynthesis. We provide to the nuclear physics community high-resolution data on the cross section and angular distribution of the Ar40(p,n)K40 reaction. These are important to various applications involving Ar40. The associated reaction rate of the Ar40(p,n)K40 process addresses a reaction rate gap in the Joint Institute for Nuclear Astrophysics REACLIB database in the region of intermediate-mass isotopes. Methods: We performed differential cross-section measurements on the Ar40(p,n)K40 reaction, for six energies in the center-of-mass system between 3.2 and 4.0 MeV and various angles between 0° and 135°. The experiment took place at the Edwards Accelerator Laboratory at Ohio University using the beam swinger target location and a standard neutron time-of-flight technique. We extracted total and partial cross sections by integrating the double differential cross sections we measured. Results: The total and partial cross sections varied with energy due to the contribution from isobaric analog states and Ericson type fluctuations. The energy-averaged neutron angular distributions were symmetrical relative to 90°. Based on the experimental data, local transmission coefficients were extracted and were used to calculate the astrophysical reaction rates of Ar40(p,n)K40 and K40(n,p)Ar40 reactions. The new rates were found to vary significantly from the theoretical rates in the REACLIB library. We implemented the new rates in network calculations to study nucleosynthesis via the slow neutron capture process, and we found that the produced abundance of K40 is reduced by up to 10% compared to calculations with the library rates. At the same time, the above result removes a significant portion of the previous theoretical uncertainty on the K40 yields from stellar evolution calculations. Conclusions: Our results support a destruction rate of K40 in massive stars via the K40(n,p)Ar40 reaction that is larger compared to previous estimates. The rate of K40 destruction via the K40(n,p)Ar40 reaction now has a dramatically reduced uncertainty based on our measurement. This result directly affects the predicted stellar yields of K40 from nucleosynthesis, which is a critical input parameter for the galactic chemical evolution models that are currently employed for the study of significant properties of exoplanets.