problems with thermostat

the thermostat doesn’t seem to be working because when we turn on the oven to bake the oven goes up to 150 degrees and then it shuts itself off where the oven returns to zero and stops heating up. the digital clock and everything works it’s just that the oven never stays on, around at 150 it resets itself. this started happening when the oven was set to 300 degrees to bake.