The P0335 is a cpk malfunction code from what I can see. It’s a three terminal gadget, right? Isn’t it just held on w/a bolt? You probably have to remove the electrical connector first, then you’ll have access to unscrew the bolt. Are you saying you’ve removed the connector & removed the bolt, but it still won’t come off? It spins in place? hmmm … well, don’t know what to tell you, no experience with removing that sensor. You have the 1.8 L engine, right? I’m not aware of any special tools needed to remove them, but sometimes there’s a special alignment tool needed when you install one.
When you get it out and on the work bench, if you like to try an experiment, measure the resistance between all three combinations of the pins, 1-2, 2-3, 1-3. What resistance does each read? From what I can tell, when you do this, you are supposed to use the + probe on the higher number of the combo. For example when you measure 1-3, put the + probe on 3.
Shops often have a lab o’scope and can use it to see if there’s a square wave coming from the sensor as the crankshaft turns. That’s the best test probably.
No harm done to clean up the connections. Might work. That part is in a very tough location, gets lots of heat and stuff kicked up and wind driven from the road.
Other things that can cause a cpk malfunction include faulty wiring from the sensor to the PCM, PCM on the fritz, or a damaged reluctance ring, that’s the gadget bolted on the crankshaft that the cpk senses.