Do you need to change the thermostat of your E39 M5? Here’s a site that shows just how to replace that thermostat. First step is of course removing the thermostat housing. After this, check the three or four O rings that should be replaced. You should also find a tube that goes between these O rings and this tube contains two O rings on both ends.
Then go ahead and replace the two O rings on this tube too. Next step is putting the tube on the thermostat housing for re-installation. And now you have a new thermostat installed on your E39 M5. Sounds simple enough and these procedures are explained with plenty of pictures in an M5board discussion.