Soaking in warm wate
If the pain is at the side of your nail it could be an ingrown nail.
If soaking the finger in warm wather with epsom salt does not relieve the swelling you might have a foreign body
(splinter) in your skin which will need to be removed by a doctor. Sometimes you will also need to take antibiotics by mouth for a serious infection. See your doctor if not better in a day or two.