I can't make out exactly how wired, it does not look correct, but could be mistaken? There are three devices built into the immersion heater, the heater its self, the thermostat, and the cut out, in your case latter seems to be built into the thermostat I can see word re-set.
So inside the thermostat there are two independent sets of contacts, the one set is operated as the tube expands and contracts there is a rod inside the tube made of a different material and that causes the contact to open when the rod heats up, plus there is a bi-metal disc which is domed and with click across if over heated. The latter is re-settable where multi-heating is used, but often not re-settable when the immersion is the only way to heat the water.
So the line (brown) goes into the thermostat, then a short link thermostat to element, and neutral (blue) goes to other end of element, and the earth goes to casing so should the element fail by going to earth, the RCD back in the consumer unit will auto turn it off.
The length of the thermostat matches the length of the element.
To test you need some thing to measure with, be it a multi-meter, or a clamp-on meter but there is nothing to see without using some thing to test with.
If there is alternative water heating then pressing the re-set is first thing to try, but if the immersion is only water heating then best option is renew the thermostat. There has been a number of deaths caused by thermostat failure, from Emma Shaw to baby where the thermoplastic tank ruptured and dropped boiling water on the baby, with the old metal header tanks it was common to hear the water boil when the solid fuel water heating had been running for some time, it was common as a kid to be told to run off hot water, as mother baking so we had too much, but for some reason plumbers stopped using metal or thermal setting plastic tanks which could take the heat, and used the flimsy thermal plastic type which can't stand boiling water, so at around £12 for a new thermostat simply not worth taking the risk.