If you have access to a hot air rework station, that would be ideal.
I don’t, so I just used a soldering iron to melt the solder on the four leads attaching the sensor to the board, and sucked up the molten solder with a solder sucker. I had to add a bit of fresh solder to help get it all molten. Then, after removing as much solder as possible, I used the iron to heat all 4 pins at once while gently pulling on the sensor. If you need more desoldering advice, youtube is an excellent resource.
To insulate the bottom of the sensor, I used some double-sided thermal tape (the kind used for attaching heatsinks).