When an attempt does not completely succeed, and many, if not most, attempts do not. Recognize and make use of the feedback. Thomas Edison is quoted as saying, "I have not failed 700 times. I have not failed once. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work." There are always lessons to be learned from trying.
6. Back up and try another way