First off, what is a build order(BO)?
Literally, a build order is a set of instructions on the order and timing of buildings and units you construct. The timings are usually timed by your supply count. At a set time you should have X supply, and when you have X supply you know its time to build a given building or unit. Its a set of orders and instructions.
Figuratively, a build order is the refinement of an idea. At first you know what you want to do, but you don't know exactly how to work it into your strategy without sacrificing too much else. You don't know when you'll have the minerals/gas to spare, when you need to start mining gas to time everything perfectly, and you don't want to go into it without a plan. So you create a build order
Example: Basic Zerg Fast Expand BO
14- Spawning Pool
This is a very basic build order for a fast expand. It has been refined and worked until it covers everything you need. It has the 14 spawning pool to defend an early attack but still gets a fast expansion, followed by the gas you need, and finished with an overlord so you can continue to build when it is all complete.
How do I go about creating a build order?
Creating a good build order is a critical skill to master, but it can be difficult if you don't have the slightest idea where to begin. First you start off with a basic idea of what you want to do. Lets say you want to try a powerful mid-early marine rush with an extremely fast stimpack and marine shield upgrade.
So you lay out a basic plan. You want to get some fast barracks but you'll need early tech labs so you can train stimpack and marine shield, thus you need early gas too so you'll go refinery before barracks. Soon after that you want two more barracks with reactors to mass produce marines. You need a basic, reliable, but not too hard opponent to play against so you pick a medium-low computer to try it out on. You try your strategy without a set build order in mind.
Next you go back and watch the replay and take note of at what supply you built everything. You write that down and see what the weak points of the build were and refine the original build. Lets say you note that the generator on the fourth rax was pointless, it took too much time to build and you were better off just pumping from the rax so you could get the attack out earlier. You also note that you have plenty of resources later on but if you call a supply drop instead of a mule you'll have the resources early on to build your third barracks sooner, even if you're 170 min behind in the end. You need the barracks now and the resources later are not important.
Ok so finally you try the refined build against another computer and it all works out very well, you're pleased with the results. You've got a working build, but you need just 1 or 2 minor tweaks before you pit it against another player. Lets say you realize that stimpack takes 30 second longer to complete than the marine shield upgrade, so you start training stimpack before the shield instead of after. This way they both complete at the same time and you can move out sooner.
Now you're ready to try your refined build order against another player. It has to come eventually, so GO FOR IT!