Watch windows failed logins

How do i watch and alert when there is a number of authentication failed events within a period of time. Can somebody help me with the code? I am new to this.