Help with script

Have you done some tutorials? Learn

For future reference, please post your code using code tags. You can look at this thread for how to do that: Using code tags properly

I really think you should try the learn section for introduction to Unity, scripting, and some basic games maybe.
I’m not sure that trying to guide you, from your current script, would be helpful.

Some points, though:

  1. selecting an object
  2. reading input and performing actions based on it, using the selected game object
  3. Read singular input in Update(). Sometimes you want to execute it in Update, also, and sometimes you want to delay the execution until FixedUpdate.
  4. Held keys/axis is okay to read in FixedUpdate (or physics callbacks, such as on collision stay)

Tried to break down some goals & ideas for you.