Set an intention. State what you want to accomplish. This may be learning to edge properly, landing your first invert or winning the pro tour. Be specific and realistic. Remember this intention when you are training. You may need to learn building blocks to achieve your goal, and knowing you're moving in the right direction will fuel your fire and increase your mental toughness.
Be prepared. To fully wrap your head around a new trick, watch videos, do drills and learn your basics. You will be mentally stronger if you know the trick inside and out and have seen it a million times. You should feel like you can anticipate where your strengths and weaknesses are physically to allow you to train more efficiently.
Visualize. Visualize yourself achieving your goal. This may be landing the trick or doing a stand-up pass. Do this often so you are familiar with your success.
Have confidence. Nothing good comes from a negative mind. Be positive and think of the small failures as learning experiences in the process of achieving your goal. If you have put in the work, both physically and mentally, you have no reason not to be confident.
Fully commit. We all know what happens when you try a new trick and don't commit. Remember your goal and keep it in the back of your mind. Rarely the goal is to just "try" something new. It is more often "to land" something new. Let that motivate and push you to commit fully and reap the benefit of your preparation.
Appreciate the process. There may be a dozen (or more!) failures before success. You will have good and bad days. Mental toughness comes when you can appreciate the process and grow from the mistakes.