We've all had unfortunate events happen in our grows, but they are usually the situations where you learn the most. You have to just try to be thankful for the knowledge and move forward to the next grow.
I grow outdoor so I just go into every season expecting shit to go sideways or be hard, then I'm pleasantly surprised when I have a good year and not as crushed when it all goes to hell lol. Low expectations = less disappointment (in growing and in life lol)
It comes with the territory. We can't control nature, so there's always variables that can throw a wrench in your grow.
That plant looks great for a first grow, minus the pests, you obviously have a green thumb, or real good beginners luck, so don't get too down on the situation, it's temporary, like everything.