Hi @cookiesss,
this is the second most basic programming exercise that exists.
The first most basic exercise is to switch a single LED on off.
Presenting you the ready t run code would be serving you cooked fish.
This is not the main purpose of this forum.
The main purpose of this forum is:
Answering specific questions that arised from writing your own attempt to create whatever kind of functionality.
You are asking for the full and working code. Break down this question into specific details such as
- how can I switch on an LED?
- how can I make a code that reacts on a button press?
If you combine such questions with the word "arduino" google searching will be very successful
https://www.google.com/search?as_q=arduino+how+can+I+switch+on+an+LED
https://www.google.com/search?q=arduino+how+can+I+make+a+code+that+reacts+on+a+button+press
Whatever question comes to your mind. Combine it with the word "arduino" and google for it
There will be plenty of hits
If you take one of these online found programs
start to read it and if you do not understand what a certain line of code is doing
ask a specific question about this line of code
If you would like to learn programming in general this is one good point to start
Take a look into this tutorial:
It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.
best regards Stefan