While getting it taken taken care of by a doctor is the more prudent option, the cotton trick can temporarily help in the meantime.
You pull a small strip of cotton about 2.5cm long from a cotton ball and stuff it under your nail, as if you were flossing your nail, with the ends of the cotton acting as a sort of cushion and softening the edges of the nail. You would then use a bandaid to keep it in place for the day. (also, you should use some antibiotic ointment before stuffing in the cotton if you have any broken/torn skin)
Again, it’s only a temporary solution, but it really does help with the pain.
The larger 'shroom looks like it’s ‘feeling up’ the smaller