I want to make a DC motor turn on while an LED is on but make it turn off when a Second LED is on with the click of a button

Yiu seem to have a certain picture of how programming works.

Well it does not work like entering the right cheat-code into a computer-game to directly reach platinum-level.

There are a quadrillion - this is a 1 with 15 zeros (1.000.000.000.000.000) ways to write code
Still for just writing code with a functionality of

For this subset of all possible codes there are still 10.000 ways to do it.
And this is the reason why it is pure luck to find exactly such a code.

The solution is:
learning programming.
Your code consists of

  • read in a button
  • switch on / off an LED
  • switch on / off a DC-motor

very basic stuff.

You can invest another 200 hours of searching for exact your code. Very unlike to find it
You can invest a tenth of this time = 20 hours to learn basic programming and you will have a solution.

So what do you prefer?