Should I analyse my dataset first and formulate hypotheses later, or formulate my hypothesis first and analyse the relevant part of the dataset later?

Should be performed before the hypothesis?

The first step is to collect as many observations as possible about the problem you are trying to examine. Then consider your observations and think about how they might relate to the problem. Try to imagine possible solutions to explain your observations.

What are the 6 steps of hypothesis testing?