You usually use straight cable to connect different type of devices. This type of cable will be used most of the time and can be used to:
1) Connect a computer to a switch/hub's normal port.
2) Connect a computer to a cable/DSL modem's LAN port.
3) Connect a router's WAN port to a cable/DSL modem's LAN port.
4) Connect a router's LAN port to a switch/hub's uplink port. (normally used for expanding network)
5) Connect 2 switches/hubs with one of the switch/hub using an uplink port and the other one using normal port.
If you need to check how straight cable looks like, it's easy. Both side (side A and side B) of cable have wire arrangement with same color. Check out different types of straight cable that are available in the market here.
Sometimes you will use crossover cable, it's usually used to connect same type of devices. A crossover cable can be used to:
1) Connect 2 computers directly.
2) Connect a router's LAN port to a switch/hub's normal port. (normally used for expanding network)
3) Connect 2 switches/hubs by using normal port in both switches/hubs.
In you need to check how crossover cable looks like, both side (side A and side B) of cable have wire arrangement with following different color . Have a look on these crossover cables if you plan to buy one. You can also find more network cable choices and information from Comtrad Cables.
In case you need to make a crossover cable yourself! You can use this crimper to do it.
Lastly, if you still not sure which type of cable to be used sometimes, try both cables and see which works.