What advice would you give to someone who struggles to move on with things that didn’t work out, and stop overthinking about it?

With time and effort, you can train yourself to move your thoughts elsewhere. Deliberately moving your attention to something in the present can help break your train of thought, and can help break the sort of obsessive cycle humans can get into.

Also, thoughts of past failure can be trigger by things that upset you in the present. So when your mind turns to the past, stop and try to figure out what might be upsetting you in the present.