appliance repairman here?

There is usually a thermocouple in front of the pilot flame. It is there to make sure the pilot is on and will not let the gas valve to open without a pilot. If your main burner is lighting its not your pilot or thermocouple. There will be at least one temperature sensor in there that tells the main burner when to come on and off (call for heat). If the main burner comes on but shuts off before reaching set temp, its probably the temp sensor.