It's supposed to pull out, but I have one in the garage I've banged and beat on to no avail. Luckily the one IN the car was easy. Try some penetrating oil and a hair drier (or heat gun) to free things up. Don't get oil in the hair drier - your wife won't like the smell or the fire.
Watch out for the brackets holding it down, and be sure to put them back so your cable doesn't stray near the exhaust.
I suggest working from the dash down to the transfer case when replacing since you have the most wiggle room at that end, then secure the brackets last. I put a little black RTV on if I'm reusing the O-rings.
The housing is indexed for the correct alignment on the speedometer gear, and there are two clips inside holding the gear on.
And when re-installing, be careful of tight bends.
Good luck.