First, I fixed your code posting as required in the instructions…
Secondly, You shouldn’t be running all that code directly in your void loop() - Use timed function calls instead, which would also make it possible to enable/disable that function as needed via various methods, App button, Physical button, time, environmental condition, etc.
For the basics on timers, see these directions… particularly the PUSH section.