turn on the led and keep it on when button1 is pushed. Then when button2 is pushed it will turn the led off.
Did you ever run across Pseudo-Code as a preliminary to implementation of any kind of software? Instead of ladder programming, what we are doing here is implementing the logic as a sequence of program steps. Instead of everything happening at once, things are done one step at at time. We can repeatedly test inputs and cause outputs to change accordingly by putting the whole logic sequence in a loop.
Is the following what you had in mind?
Turn on the LED when button 1 is pressed. If you release button 1 the LED stays on until you press button 2. If you release button 2, the LED stays off until you press button 1 again.
Here is a way to express that simplest of specifications in pseudo-code:
Loop Forever
BEGIN LOOP
IF button1 is pressed THEN
Turn on the LED.
END IF
IF button2 is pressed THEN
Turn off the LED.
END IF
END LOOP
Or what?
To me, the first step is a complete and accurate statement of the problem. Sometime pseudo-code helps organize things before implementation. It also serves to convert the program specification to some (maybe more succinct) architecture-independent sequence of program steps that can convey the intent to us mere humans (and serve as a reminder to yourself of what the heck it is that you intend to do) before trying to tell the compiler what we want the hardware to do.
Now, if my pseudo-code does not convey your intent, then maybe you can tell us a little more. For example, after pressing button 1 is it really necessary (or even desirable) to wait until the button is released before continuing? If it is, then add it to the pseudo code at that point. Do you need to handle a situation where both buttons are pressed at the same time? What are you supposed to do with that? Maybe the "IF" stuff needs to be a little more elaborate. Stuff like that.
My main point is that for people with no programming experience I recommend that they go through some of the examples and make sure they understand the syntax and semantics of simple sequences.
After the supplied "Blink" sketch, a program that uses two buttons to turn the LED on and off seems to be a great next step. Just start with the simplest possible operation (maybe like my pseudo-code) and make absolutely, positively certain that it works exactly the way that you expect. You will discover that putting extra semicolons after "if" clauses creates programs that don't work as expected. Attack that problem. Fix it. Then "enhance" its operation if you want to do something more elaborate.
Regards,
Dave
Footnote:
Programming and debugging are learned skills. Different people have different ways of learning. Helping people is a learned skill. Different people have different ways of trying to help.
You do your best and we will do our best. After all, no one was born knowing this stuff, right?