An ingrown hair anywhere can really hurt. If it's in a sensitive spot, like on your penis, it can hurt even more. The best way to treat it is just like any other ingrown hair. You should not try to "pop" the hair or it could get infected. Try to pull out the hair with a tweezers.
What I have done with mine is to use a small razor blade to make a small cut in the top of the raised skin. Then use tweezers to grab the hair and pull it out.