I could, but I am not going to. You will learn more by doing it yourself
read the button input
has it changed since last time ?
if it has changed is the button now pressed ?
if yes then it has become pressed so increment a counter and take action based on its value
save the current state as the previous state ready for the next test
keep going round this loop