Ugh sorry to hear that. It’s so frustrating. I wasn’t in that exact situation, but had a job where I was better at doing it than my supervisor and he frequently took credit for my work, and made last minute changes to things to set me up for failure so then he could swoop in and “fix” things and make himself look good for upper management. I tried meeting with management about it but they loved him because he knew who to suck up to, and so they wouldn’t listen. Fortunately I was able to maneuver my way into a new role that wasn’t under his supervision, and that allowed me to minimize direct contact with him. He left the company before me and multiple complaints came out against him that validated what I had told management. It was such a frustrating situation and I was happy to finally leave that company. All that to say, I hope you find ways to minimize the negative from that coworker. Probably there is no single “right” way to approach it, but just don’t let yourself be gaslit or taken advantage of.