Using one button to trigger different actions

I cant seem to figure out how using one button (to any pin) I can trigger different actions. Say for instance I press said button once it runs action A and if I press it twice in one second or so it runs action B. Is this even possible?

Of course it is possible. You have to delay acting on the first button press until one second has elapsed. While waiting for that second to elapse you have to count the number of times the button is pressed. If at the end of the second the count is 1, do A. If the count is 2, do B.

This is a classic situtation where you would design a state-machine - if you've not programmed state
machines before its will worth learning about them. Finite-state machine - Wikipedia