The structure 首先…其次… indicates that two actions happened one after another.
Scheme
首先
action 1
其次
action 2
If a sentence has one subject, the subject is placed at the beginning of the sentence. Specifically, it is placed either before the structure or after 首先.
If a sentence has two subjects, the first subject is placed after 首先 and the second subject is placed after 其次.
Examples
不管做什么事情,首先你要明白你为什么要做,其次要知道怎么做
Whatever you do, you first have to understand why you are doing it. Second, you have to know how to do it