I would say both because, if you try to figure out the problem yourself first. You'll improve your problem solving skills by trying out things and learning what works and what doesn't (or/and what doesn't really work). If after a while you can't find anything that works then Google it so that you can see if your solutions were close to the correct one(s) and also try to find more ways to solve a problem.
It's like in an assignment/exam where you're facing a question you don't really know, if you try solving it with your own solutions and fail, you'll learn that those solutions doesn't work in the aspects they failed and then check the solution to see how close one of your solutions was to it and what you did wrong.
Just like one of the proverb says:
It's by making errors that you know what is wrong and it's by learning from those errors that you improve yourself and become better at solving those problems