Q235 carbon steel is a commonly used engineering material, but its application in marine environments is limited by its susceptibility to corrosion, especially localized corrosion that can lead to material perforation. Effective inhibitors are crucial to addressing this issue, particularly in acidic environments where localized areas become increasingly acidic. This study reports the synthesis of a new imidazole derivative corrosion inhibitor and evaluates its effectiveness in corrosion inhibition performance using potentiodynamic polarization curve and electrochemical impedance spectroscopy techniques. High-resolution optical microscopy and scanning electron microscopy were employed for surface morphology analysis. Fourier-transform infrared spectroscopy was used to explore the protection mechanisms. The results demonstrate that the self-synthesized imidazole derivative corrosion inhibitor offers an excellent corrosion protection performance for Q235 carbon steel in a 3.5 wt. % NaCl acidic solution. This inhibitor can provide a new strategy for carbon steel corrosion protection.