You have three options when you get stuck: keep going, give it a break, or quit.
Being stuck is part of making progress. The real problem though is that we often interpret stuckness as a failure. Having a bad experience undermines the enjoyment of doing. It convinces us to switch subjects to something newer and achievable.
Mathematics is one of those discouraging topics that gets left behind as we age. We lose patience with math's rules and exactitude–the answer is either right or wrong. But it's not as rote as it seems. Says famed mathematician Andrew Wiles: “it's extremely creative. We're coming up with some completely unexpected patterns, either in our reasoning or in the results.”
Math, just as playing sports, writing and other crafts, takes persistence. Maintaining excitement and having faith in the process are the keys to sticking it out.
“Yes, you don't understand [something at the moment] but you have faith that over time you will understand — you have to go through this. It's like training in sport. If you want to run fast, you have to train. Anything where you're trying to do something new, you have to go through this difficult period. It's not something to be frightened of. Everybody goes through it.” — Andrew Wiles