The figure shows an anti-bounce circuit among many that can be found on our website and in our publications. The logic used depends on the application. In this case, it is CMOS.