What can I do to treat a joint infection after a total hip replacement surgery?

See your surgeon. This is potentially serious complication that needs to be treated by your surgeon. Depending on how long it has been present, this may require a surgery to wash out the joint, or removal of the joint, followed by weeks of antibiotics.
Joint infection. Serious problem--check with your orthopedic hip surgeon. Depending upon the bacteria and time from surgery, may consider 1or 2 stage revision.
Serious problem. Depends upon bacterial type as well as time since surgery. Likely candidate for 1 or 2 stage revision, removing the primary tha on the first surgery with thorough irrigate & debride with antibiotic spacer for 2 stage, trim plantation at same time for 1 stage.