Sometimes the hotend thermistor may get broken or damaged due some circumstances and in these cases you can follow this instruction to replace it. For a start loosen the bolts shown with red arrows in the following picture.
After this move the hotend cover / fan holder safely aside, but be careful not to break the wires while doing so.
After this take a look on the side of the hotend and you can see one more screw as shown with red arrow in the following picture. Open this screw and remove the thermistor from the hole. Remove the thermistor connector near hotend. Unwind all the yellow kapton tape around the wiring harness so that you can get the thermistor and wires out.
After this install new thermistor doing the steps in opposite order and when installing the wires under the washer/screw in hotend, please be careful to not tighten the screw too much as it can cause the wires to cut or get shorted.