It can happen both ways separately and at the same time.
If you're raised in a culture of consumer materialism and you have never had any experience that would develop the sensibilities for understanding what you are and require as a human being, then you will engage in materialism and be unhappy without understanding what possibly could make you happy or content with your life.
On the other end you may begin generally unhappy and attempt materialistic aims as a way of coping with your long term unhappiness through short term consumption highs.
When it's both you're basically caught in a cycle of stubborn denial that you have no fucking clue what you're doing with your life.