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:
- selecting an object
- reading input and performing actions based on it, using the selected game object
- Read singular input in Update(). Sometimes you want to execute it in Update, also, and sometimes you want to delay the execution until FixedUpdate.
- 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.