The answer is to gain experience by studying patterns in other problems. You learn to recognize patterns through practice. It is okay if you don't recognize how to find the pattern in this example at first, but now that you have been shown the pattern, study it carefully and try to see if you can understand why the pattern emerged and how, in hindsight, you could have noticed it. If you don't go back and understand how this pattern works after it has been revealed to you, you'll be in no better position to discover a pattern the next time you need to.
For example, in this problem, notice that the recurrence relation involves dividing by $2$. Is it any surprise, then, that in the pattern for the sequence $a_n$, the denominator in each successive term is the next power of $2$? The numerator is more subtle, but if you study it carefully, you will uncover its pattern and, much more importantly, the explanation for the pattern as well.
Math is a challenging subject that requires you to always be thinking critically and asking yourself why things are working out the way they do. If you adopt such a mindset for solving problems, you'll start to notice more and more as time goes on.