After removing the big plug nut on the end, the part you circled is a snug fit and should fall out with a couple of firm taps on a block of wood.
Mine wasn't being very friendly and I used a little heat (hot air gun) on the aluminium to help it. Don't heat it too much, just enough so you can still hold it with your hands. The aluminium expands enough at that temperature to help it come free.
It will be full of gunk and sludge and that will be holding the sliding piston so it won't come out easily. Leaving it soak in some brake cleaner over night would also help loosen it up.
I used a piece of rubber sheet to clamped it in a bench vice and block to (rear brake) two ports and brake switch port. The switch port needed an extra layer of rubber because there is a little height difference. It came out with a little air pressure on the front two ports.
Since you have been experiencing problems with the brake witch, you might not get it out so easily. My next step, if the air didn't work, was going to be a zerk fittng and the grease gun to push it out.
Here are some extra phots. Hope that helps you.