Well, you have multiple GameObject.Find and GetComponent calls that aren’t checked for a valid result. Any one of those things could be failing. You need to check that the results of each of those calls isn’t null prior to trying to access any reference they may contain.
The error should tell you the line the null reference is happening on.
I’m guessing line 9, where you use hit.collider.ToString() - not sure what you’re expecting there but you haven’t passed that RaycastHit object to any actual raycasts (creating a RaycastHit or Ray object does not perform a raycast, they’re simply data structures). Without a performing a Physics.Raycast to populate the RaycastHit data structure of course it’s going to be null.
You also really shouldn’t be using GameObject.Find in the update loop, that’s going to be horrifically slow – you could simply use hit.collider.gameObject as every Component class has a reference to the GameObject it’s attached to.
Don’t want to sound cruel here but you’ll honestly be best served by spending more time following programming tutorials (generic ones, preferably C#, not Unity tutorials) before jumping into writing gameplay scripts. There’s so many things you don’t seem to be aware of and you’ll likely hit several walls every time you take another step. Perhaps look in the education forums for some good resources for learning.