How do I fix this Null reference exemption error and how can I prevent from getting them?

Please edit your post according to this: https://discussions.unity.com/t/481379
We won’t count your lines. You know… which one is the 25th line in your wall of text?

Although if I have to guess, you probably don’t have any GameObjects called “Enemy”.