Coffee is a relevant agricultural product in the global economy, with the amount and quality of the bean being seriously affected by the coffee berry borer Hypothenemus hampei (Ferrari), CBB, its principal pest. One of the ways to deal with this beetle is through biological control agents, like ants (Hymenoptera: Formicidae), some of which are characterized by naturally inhabiting coffee plantations and feeding on CBB in all their life stages. Our paper considers a predator–prey interaction between these two insects through a novel mathematical model based on ordinary differential equations, where the state variables correspond to adult CBBs, immature CBBs, and ants from one species, without specifying whether preying on the CBB is among their feeding habits, in both adult and immature stages. Through this new mathematical model, we could qualitatively predict the different dynamics present in the system as some meaningful parameters were varied, filling the existing gap in the literature and envisioning ways to manage pests. Mathematically, the system’s equilibrium points were determined, and its stability was studied through qualitative theory. Bifurcation theory and numerical simulations were applied to illustrate the stability of the results, which were interpreted as conditions of the coexistence of the species, as well as conditions for eradicating the pest, at least theoretically, through biocontrol action in combination with other actions focused on eliminating only adult CBBs.