Split your world into sectors. Within each sector, start by doing an inexpensive initial test (usually bounding boxes or spheres), and for potential hits, possibly do a more correct (and expensive) test.
How to partition, how to do initial-test, and how to do expensive-test all depend on your game... 2D vs. 3D, data structures you use, etc.
But as mouser said, you might want to grab an existing engine unless you feel like doing your own collision detection for the sheer learning experience