You have basically two options:
Read the first N-bytes until you get a correct opcode (e.g., 05 14 00 00 00 decompiles to add eax,0x14). Disassemble the next opcode. You will read some data sections and get invalid opcodes. You may skip the process or mark these "instructions" as bad and proceed until you get the next valid opcode and resume as described.
Read the first N-bytes until you get a correct opcode. Proceed until you disassemble any sort of jump, store your current position, follow the jump and proceed as described. Stop disassembly when you get an invalid opcode and resume at the previously stored position.
Both approaches require some basic information like
- Where does your program code start?
- What architecture is the code for?
Some of these information are part of the header (e.g., in PE- oder ELF-Files).
The Linux Interactive DisAssembler (LIDA) has a short introduction how the program disassembles the code and how objdump does its work. This is a good starting point to get familiar with the topic.