What do you tell yourself when things get hard? I’m more curious to know what other people tell themselves or what they do. What do you tell yourself when your stuck?
If I am ever really stuck with something (whether coding or not) I just take a break. I watch a documentary, have a nap or have a nice shower.
Often my brain will suddenly shout up in the middle of the downtime giving me a way I could solve that code challenge I was stuck for ever on. It sounds strange, but it really helps to just take a break so you can tackle it from a fresh perspective.
Similarly if I'm having difficulty visualising a task I just draw it out showing how I want a program to work, then implement it.