Welcome to the forum.

Maybe this will get you started.
Code:
CHECK:
high mosfet
IF boton = 0 THEN TEST
GOTO CHECK

TEST:
cnt = cnt +1
IF cnt = 3 THEN OFF_LED
RETURN

OFF_LED:
cnt = 0
low mosfet
pause 1000
GOTO CHECK