This paper presents the temporal and spatiotemporal dynamics of a delayed prey–predator system with a variable carrying capacity. Prey and predator interact via a Holling type-II functional response. A detailed dynamical analysis, including well-posedness and the possibility of coexistence equilibria, has been performed for the temporal system. Local and global stability behavior of the co-existence equilibrium is discussed. Bistability behavior between two coexistence equilibria is demonstrated. The system undergoes a Hopf bifurcation with respect to the parameter β, which affects the carrying capacity of the prey species. The delayed system exhibits chaotic behavior. A maximal Lyapunov exponent and sensitivity analysis are done to confirm the chaotic dynamics. In the spatiotemporal system, the conditions for Turing instability are derived. Furthermore, we analyzed the Turing pattern formation for different diffusivity coefficients for a two-dimensional spatial domain. Moreover, we investigated the spatiotemporal dynamics incorporating two discrete delays. The effect of the delay parameters in the transition of the Turing patterns is depicted. Various Turing patterns, such as hot-spot, coldspot, patchy, and labyrinth, are obtained in the case of a two-dimensional spatial domain. This study shows that the parameter β and the delay parameters significantly instigate the intriguing system dynamics and provide new insights into population dynamics. Furthermore, extensive numerical simulations are carried out to validate the analytical findings. The findings in this article may help evaluate the biological revelations obtained from research on interactions between the species.