Can you teach me how to code for a temperature alarm

Hello! Can you teach me how to code for a temperature alarm... Where the app will produce an alarm sound once the temperature gets too hot. This is for our school project, thank you!