To replace a malfunctioning thermostat in your MG MGB, start by draining the coolant from the system to prevent any spills. Locate the thermostat housing, typically located at the engine block or cylinder head. Remove the housing, taking note of the orientation of the thermostat. Replace the old thermostat with a new one, making sure to install it in the correct orientation. Finally, reassemble the thermostat housing and refill the coolant system with the appropriate coolant mixture.