The choice to buy a horse is entirely up to the individual situation, but if you are struggling with your confidence in riding right now, it might be better to wait.
If you are not confident with jumping, and it is something you want to get back to, the best thing you can do is start riding again, and work your way up to jumping with a calm, relatively easy, confidence-boosting horse. A quality lesson horse will give you what you need in terms of rebuilding your confidence, and then you could look into buying a horse.
I caution buying a horse to get your confidence back, because of the potential negative outcomes. If you get a horse that is a little hotter, you may become more nervous, and create another bad situation. This will impact your confidence more, and affect your horse.
If you get a horse you can build up your confidence the more you trust and get to know it.
Before I got my boy 2 years ago I was terrified of jumping above 2ft but now i am confident enough to jump up to 4ft. Couldn't have done it without him.