Switches and push buttons need debouncing. It is straightforward to do this with software, using a library. The advantages of the Switch library are: External pull-up resistors are not required.
There are a number of great libraries out there to allow IoT devices to connect to the internet using a variety of network protocols. For cellular-enabled devices, the choice typically falls on ...