I've often seen English speakers saying "That's the spirit". But, what does it mean? And in what circumstances can I use it?

Native speaker’s answer
Rebecca
"That's the spirit" is an expression that's used to express approval toward someone's attitude. It's similar to saying, "you have a great attitude." You can use this expression when someone has a good attitude, even if their situation isn't great. A: I'm trying to stay positive during this pandemic. B: That's the spirit!