To prevent an ingrown toenail from coming back make sure you wear good comfortable shoes that provide adequate room for your toes.
Next you should keep your feet clean and dry at all times, and be sure to trim your toenails properly, avoid trimming your toenails shorter than the edge of the toe.