He was pretending he was ok for a long time after losing his mom, dad, Mjolnir, his eye, his home, his best friend and his brother. He obviously wasn't. He held onto hope that he could defeat Thanos but failed at that too. He still held onto hope that he could undo it all at the start of the movie and he still failed but he got an unsatisfying kill of Thanos.
He broke. His spirit was gone.
Then he talked to his mom and got the advice he really needed to hear and he started to rebound. Now he's on a new path of self discovery with the Guardians.
I really liked building him up to this happy go lucky character then breaking him down only to rebuild him.