There are many skills (curiosity, persistence, willingness to improve, etc) but IMO the most essential is being able to deal with your own frustration.
What I've found works better for me is identifying when things are barely starting to get ugly and calm myself. I tell myself that this suffering is temporary and remind myself I've been able to solve pretty much any problem I've faced.
I think this confidence is really important and part of it seems to come from having solved lots of problems in the past / working through frustrating periods. That's why "write lots of programs" is still my favorite piece of advice because it's a lot like "show up to the gym" if you want to get stronger.