One is the square-ish D shaped connector found only on devices (ie your printer or an external hard drive. They are only on things that get plugged into something else--devices.
The other are the flatter rectangular ports found on anything you plug things into (ie your computer or a router that can share a printer). They are only on things that things get plugged into--hosts.
Some things--hubs, mostly--will have both, since they can connect to a host as well as other devices, which they pass through to that host.
Since the only USB cables you'll ever find have one of each kind of connector on each end, it's pretty much impossible to hook anything up wrong.