The wettability of the rock–oil–brine system plays a major role in enhanced oil recovery (EOR), particularly in the harsh environments of carbonate reservoirs. Most of these formations were identified as strongly oil-wet, and sometimes a few are intermediate-wet. Hence, it is highly necessary to alter such an oil-wet rock matrix to a water-wet matrix in order to improve the oil production. Consequently, it is important to investigate the wetting and wettability dynamics of the rock–oil–brine system for both static and dynamic cases. Thus, in this study, we investigated the effect of four various imidazolium-based ionic liquids (ILs) on the wettability alteration of the rock–oil–brine system by measuring the contact angles. Herein, we have screened various parameters, such as the rock type (brine-saturated and oil-saturated), type of IL, IL concentrations (0–1000 ppm), temperature (25–100 °C), pressure (14.7–3000 psi), and salinity (TDS: 67,500–240,000 ppm). The measurement of the static contact angle was found to be altered from 85.5 to 49.4° with the addition of 500 ppm of ILs in the brine-saturated sample, and for the oil-saturated sample, it was altered from 150.9 to 99.2°. This indicates that ILs have a huge influence on shifting the rock wettability more toward water-wet, which in fact is more favorable for the EOR operation. Later, we studied the dynamic wettability alteration of the rock–oil–brine system, in which we measured the transient changes in the contact angle while displacing the brine with an IL solution in situ. It was observed that the oil droplet deformed slightly and was dragged toward the base fluid (IL solution) with time, and this implied the changes in the contact angle from 150.9 to 118.5° with 500 ppm of IL, [C12mim]+[Cl]−. Though this has a relatively lesser impact as compared to the static experiment, this could be considered to be more realistic to correlate with coreflood experiments. Further, to understand the mechanism of this wettability dynamics, we have measured the oil–water interfacial tension and the ζ-potential of various systems and observed that their results were backed up by our wettability studies. Overall, the combined forces of interfacial tension reduction, capillary alterations, and IL interactions with rocks and oils have caused this wettability alteration. Conclusively, the results of various experiments that are performed in this study are more meaningful, and it is evident that ILs favor the successful EOR implications.