You can first practice using a Pi Camera:
Then, connect a button to the Raspberry Pi GPIO. See the image below.
Here is an example of the python code that takes a picture each time you press the button and stops when you press "Ctrl C":
from picamera import PiCamera
from time import sleep
from gpiozero import Button
button = Button(17)
camera = PiCamera()
camera.resolution = (1920,1080)
camera.start_preview(alpha = 200)
frame = 1
while True:
try:
button.wait_for_press()
camera.capture('/home/pi/Desktop/frame%03d.jpg' % frame)
frame += 1
except KeyboardInterrupt:
camera.stop_preview()
break