Here are a few things you could try (I use Godot not Unity so...):
Let's say for example we are fixing the bug that spawns 2 tanks. You could:
Search for a tutorial on how to deal with player deaths or how to make a top down shooter(Like this:
) From there you could add your own features.Rewrite the code that handles player death. Process the logic of your original code and figure out why it isn't doing what it's supposed to. For example maybe you made it to where every time the player gets hit with a bullet it spawns again. Then fix the bug and explain what the code should do to yourself before you playtest it.
Ask for help on a discord server or from a friend.
Watch these videos made by people more experienced than me:
Idk... I'm out of ideas lol.