If you've been following step by step, you'll have seen the image below before - if not, don't worry!
This diagram (or similar) can be found in your configurator- in betaflight, it's under either the "Motors" or "Configuration" tab. For the purposes of this guide, it doesn't matter if your motors are reversed or not, we only care about the numbers - these indicate the position of the motor.
Under the "Motors" tab (you are likely already in this tab if you can see the above diagram), you will see a settings / control panel which looks like the image below. Make sure to read the warning we've highlighted in this image, and REMOVE YOUR PROPELLERS! We'll be spinning the motors up in a moment, and we don't want any damage or injury, or unexpected flight.
Once you've made sure no propellers are attached and they're well away from you so the urge to reattach them has entirely dissipated, enable "Motor Test Mode" by clicking the switch next to "I Understand the risks" (you did remove your propellers, right?). You have now armed your drone, and the vertical sliders can be used to spin up the motors. Move on to the next steps below the screenshot.
Now, lift the number 1 slider a little, slowly, until a motor starts spinning on the drone. Make a note of where it is on the drone - see the diagram below for an example.
Drop the slider back to 0 and repeat for sliders 2, 3 and 4, until you have a completed diagram like below;
If your diagram matches the configurator diagram, then there's nothing to worry about! Your motors are in the right position and you can move on. If they don't match, then here's how to sort it;
Go to the CLI tab, and wait for it to load completely. When it does, type "resource" and press enter. You will be given an list of all the inputs/outputs on the drone, it may look confusing. Don't worry! Look for the "motor" resources shown in the diagram below. For a quadcopter, we're only interested in motors 1 through 4;
Now, write these resources next to the corresponding motors on your diagram - see below for an example with our diagram;
Finally, on the diagram, write the "Correct" motor positions from the configurator - this may look a bit busy on the diagram, but it will help in just a moment;
Now we can easily see which resource should be assigned to which motor. For example, Motor 1 should use resource C07 in our diagram above, but C07 is currently assigned to motor 2. So, here's how we fix that;
Open a text file and copy and paste the following;
resource motor 1
resource motor 2
resource motor 3
resource motor 4
save
Next to each line, write the resource from your diagram which is in the position that the motor *should* be in. That is to say, use the numbers we added last to the diagram, not the ones from the start! To help explain, here's what our example fix would look like;
---EXAMPLE DO NOT USE----
resource motor 1 C07
resource motor 2 C08
resource motor 3 C09
resource motor 4 C06
save
---EXAMPLE DO NOT USE----
Now you have your completed fix, copy all the text from your file, and paste it into the CLI in Betaflight. Press enter. Your drone should apply the new map and reboot. Once it's rebooted, test the motor positions again using the steps from the start, and you should find they're in the right places! If they aren't, you may need to repeat all steps above.