Switch off the power to the immersion heater at the consumer unit, test with a decent tester (not a neon screwdriver) that there are no live cables at the switch or at the immersion heater; one by one, so that you do not get them mixed, undo the terminal screw and remove each cable from its termination, make sure the cable end is not contaminated and then replace each one ensuring you are not trapping any insulation under the screw and also not leaving any cable exposed copper (either strands of cable or a section of the cable) visible outside the terminal and re tighten the terminal screw so that the cable is firmly held in place.
Do this at both the switch and the immersion, this should resolve the problem.
IF you are unsure what you are doing or you do not feel confident in doing this then do not undertake it as it could be fatal.
Call an electrician to check the circuit instead, they will be able to test and check and re terminate faster and better, they could also replace the cable if it has been heat damaged.