How do you handle debouncing for a physical button connected to a GPIO pin? Describe both hardware and software approaches.