Inhibitors are frequently used for controlling sulfur corrosion in oil and gas production due to its low cost, easy operation and significant effects. In this study, a corrosion inhibitor TD-02 was prepared, and the properties of TD-02 were investigated by weight loss, SEM and electrochemistry measurements in saturated hydrogen sulfide solution. The results show that significant inhibition effect was achieved by adding TD-02 as inhibitor. A protective film is formed by adsorption of inhibitor molecules on the matrix and inhibition achieved by geometry covering. The field test results indicated that the wear of the compressor shaft was significantly inhibited, which achieves the desired results.