Each component slot on the motherboard fits a certain type of computer part spec.
Motherboards tend to support one CPU Socket Type (i.e. LGA775), so buy a CPU with the same socket type.
Motherboards tend to support a range of RAM speeds (DDR3 1333/1066), so buy RAM with that supported speed.
For other parts:
* same storage interface for hard drives (i.e. SATA 3.0)
* same expansion bus for video card and expansion component (PCI-Express, PCI)
Try visiting newegg and put parts together based on the part specs. They're pretty good about part details.