There are many defnitions of these words.
I think of guilt as about acts.
Shame about what you are.
Obviously there are gray areas and overlaps.
I also distinguish guilt and remorse, the latter being useful, the former not.
You do something you yourself think is bad or might be and you walk around feeling bad, thinking you are bad. Helps nothing, does not evolve, will likely be repeated. Its a kind of self-punishment. Remorse is when it hits you emotionally - shit, I hurt that person I care about. It’s not about you and if you are bad. It’s about the effects of your action that you realize you do not like and don’t want to repeat. That can lead to some kind of growth. Guilt is just self-flagellation.
Shame is about who you are at root. It might become clear though an act or through failure or rejection.
Sometimes people talk about healthy shame. I think that’s a poor word choice, because people will then think whatever shame feel is probably right and good.
I do think that getting frustrated with one’s abilities and wanted better can be a very good thing. I just wouldn’t use the word shame.
Guilt is anti-life and stagnant. Remorse is not these things.
Shame is generally a dead end, a kind of reverse narcissism. Though of course narcissists have a lot of shame they are running from.