Naming organic compounds
An organic name is a description you can read back into a structure: the root tells you the length of the longest carbon chain, the ending tells you the family, and the prefixes tell you which branches are attached and where.
A worked example
Name CH₃CH(CH₃)CH₂CH₃. The longest continuous chain contains four carbon atoms, so the root is but-, and because every carbon-carbon bond is single, the ending is -ane, giving butane. The single CH₃ branch is a methyl group, and numbering from the end nearer the branch places it on carbon 2, so the complete name is 2-methylbutane. Numbering from the opposite end would give the branch the higher number 3, which the naming rules don't allow.
The mistake people actually make
The longest continuous chain isn't always the one that happens to be written in a straight horizontal line. Trace every possible path through the carbon atoms before choosing the parent chain, because a branch drawn at the end of a line can actually extend the main chain and change the name completely.