Tractor ignition keys are not like the ignition interlock on a car... there's no mechanical link to the gear shifter, the brake pedals or anything else that can get hung up... it's just an electrical switch. So you can unplug the connector, unscrew it from the "dashboard", take it to the dealer and ask for a replacement. Or, order one online, etc.
But the other advice is spot on, too. When the old one gets wonky, sometimes lubing it will free it up so it'll work again for a while. Just about every old tractor I ever saw lived a good part of its life with a funky ignition switch. Then one day the owner got tired of fiddling with it and bought a replacement for $5.