I will answer this question not from the perspective of SW engineering but rather scheduling. Obviously, there is some SW design build method you ought to follow but there are some considerations around scheduling that is true no matter the type of project, but that you need to equally consider along with the SW method.
First, sequencing of work is dictated by the logical work flow, meaning work A needs to occur before work B in all cases. Think: you cannot paint your wall until you hang the dry wall, which cannot be done until you framed out the room. This type of sequencing comes first.
Second, you have another issue with resources doing the work, either human or materiel, or tools. A person doing work A cannot do work B at the same time, so these are sequenced accordingly. It is not a hard sequence as you have some choice.
Third, you have soft logic built into your sequencing, which means you are simply choosing a sequence. In the schedule, you would create a dependency, even though it is a soft dependency.
You have options and play with the second and third type of sequencing and here is where the analysis begins.
While we put hard numbers in the schedule in terms of hours, days of duration, and resources, the work is actually probabilistic in a very random way, called aleatory uncertainty. So, based on the estimated logic you created against the work, you can model different sequencing scenarios that provide you with the best case in terms of lower risk. If you alter sequencing for the second and third types, you can materially change your risk posture, creating the most buffer within the work, thus minimizing the critical path.
Each project is different so there wouldn't be an answer from a scheduling perspective that would say, do this before that all the time. It is an analysis that would be done for each project during planning and replanning stages.
From a PM perspective, hope this helps.