I am a manager and I think PIPs are great for the manager and the employee.
Now that the issues have been clearly described, seperately from each other (hopefully) and a plan for improvement identified, your situation should become easier and more stable. I know it doesn't feel like that (it feels like a huge criticism and a slap in the face), but now is your chance to state what you need from your manager to make the changes they want. You should do this on the PIP as soon as you can - include training courses if appropriate, a request for a weekly update on your progress (which you'll take notes at and specifically ask them to detail anything going well/badly, a request for supervision/shadowing sessions if you think that'd help .... basically whatever you think you'll need to make the improvements.
If there are a lot if improvements or training will take time to organise, don't be afraid to ask for the PIP timescales to be extended. And if the regular (weekly?) updates show that things are taking longer to improve than thought at the start of the PIP, negotiate extensions to the timeframe as you go. Don't let it get to the end date of the PIP and then reel out your reasons for not achieving it - if you want to keep your job then you must succeed at the PIP, so don't let it end until you're improved sufficiently to come off it.
Basically, what I am saying is that you need to tackle this dispassionately. Spend tonight feeling sorry for yourself, then tomorrow you start to manage this process in order to succeed at it. That means orgainisation, no emotion, standing up for yourself if you need more time, being clear about what you need from them. It is a business process, not therapy.
If you can keep your was through this process you'll almost certainly improve to the standard required. If they are not reasonable about this process, then you and they have just created a paper trail that proves it, which they'll feel threatened by. On the off chance you truly can't improve to the required standard, then you'll know you did your best, and you will be a stronger, more knowledgeable person for having done the process properly.
The absolutely worst thing you can do is be apathetic or stroppy about this. The process will be designed to manage you out as an end point, and if you don't change the course of the process then your manager has no option but to just follow the process to that conclusion. Unless you're truly incapable of doing this job (which sounds unlikely given you've been there three years with no one noticing), this is the best way to turn it around.
Good luck!