looks like a 3/8" recessed contact
https://www.amazon.com/Recessed-Window-Contact-Sensor-Magnetic/dp/B07ZQ9RNK7/
you should be able to gently pry the contact side out of the door part that doesn't move and just cut the wires and connect the new one. if the magnet is the part that failed, on the door side, same idea; gently pry it out and then pop in the new one.
i like these for crimping the wires https://www.amazon.com/Dolphin-DC-100S-Super-Connector-Sealant/dp/B000JP3GB6/ might be overkill if you only have this one door though.