Treat success and failure as the impostors they are. The rejections are probably not as bad as you think, the acceptances not as good. You are playing a long game; it’s not a sprint. Build up a body of work that can’t be ignored. Aim to be a stronger writer with each project you embark on. Dismiss rejection (even though it may be deserved), and briefly enjoy publication. But then move on and write something else. Remember: writers write.