...Is the only permanent solution.
Just the painful border can be removed, or the entire nail if necessary. After removal you can let the border grow out again or your doctor can use a chemical to stop the nail from regrowing. If you're concerned, don't perform bathroom surgery on yourself. That can lead to an infected ingrown toenail, which could require antibiotics. The pain is minimal afterward.