hang nail

I have an infected hang nail how do I get rid of it ? I want to pull it out and get the pus out but I'm not sure if that would be safe