All the legislation - and all the black-and-white, clear-as-a-bell written contract does no good when it's your boss harrassing you - particularly when they manage to bring economies/cutbacks ito it - because this means their managers will back them up no matter how blatantly outrageous their behaviour is.
Do not depend on a union to help you out; do not expect any rep to come prepared to any meeting. Know what you want to achieve if you decide to fight it. Be warned - compensation isn't actually usually all that much - a few months', maybe a year's pay,if you're lucky - but that can be after months of lost pay.
Know how long any sick pay lasts, and how long you can afford not to work after that. In practice, employers depend on everyone being in debt and unable to see a dispute through financially.
Make sure that if the company refers you to a doctor fopr assessment, that YOU get yourself a copy of not just the diagnosis sent to your company, but your company's referral letter to them. Get it from the doctor directly - companies usually do their best topretend they "haven't got it yet" if it isn't what they wanted.
Remember that you have the legal right to see any and all communications that are about you -- emails written about you as well as to you.
It also includes your entire personnel file (not edited highlights). But do not expect your bosses to either know this or to believe the law on personal data / freedom of information applies to them. HR departments do usually know this, and although they will fob you off endlessly, it scares the bejesus out of them. (In practice, emails about you will never be revealed to you, law or no law; and in practice your personnel file will be carefully culled before it's shown you: but they dare not hang onto combustible stuff either, in case it goes to court.)
You need to decide quickly whether it is ever going to bearable to come back to work; and what you're going to do if you don't return.
All the above advice about keeping records is an absolutely essential first step. Also - if you are ever invited for a "chat" - insist on knowing what the exact status of any private meeting is, and insist on having someone of your choice in there with you. (Be careful of attempts to retrospectively label "chats" as either disciplinary or grievance meetings.)