This is difficult to answer in a simple way, but fundamentally scientists use a combination of very clever chemistry and mathematics to locate genes. It's a lot of hard work. Initially, the rough location of a gene can be discovered by very old fashioned genetic techniques that simply look at the way traits are expressed after breeding two individuals. This is all about dominant and recessive genes, recombination, and especially linking. You will need to look all this up in an introductory biology book because it is impossible to explain it all in this answer.
Basically, genes can be linked to one another. That is, when an individual reproduces and the genes from the father combine with those of the mother and there is a natural mixup in the copying of the genes (a mutation), this mixup does not affect just one gene, but usually a group of genes. Since the group of genes contain the code for a number of various things, when the mutation happens the resulting individual has traits that are coupled to each other. This is called linking. For instance, the gene for Cystic Fibrosis is probably linked to a gene that provides resistance to certain diarrhea diseases. Ultimately, through a lot of hard work, geneticists find literally millions of such linkages and by examining different recombinations of genes they can work out the frequency of these linkings. This is where the math comes in. It turns out that the more frequent the linking, then the closer the two linked genes must be on the chromosome. In this way you eventually get a map of the chromosome and where certain genes are.
From David Baillie, SFU geneticist: "It is really quite simple, in old days (the way CF was done by Francis Collins and Lap-Chee Tsui) the gene is found by virtue of the fact it is near to something else that you already know how to detect. In the simplest case, the gene that causes the problem might be close to another gene that has a known location on a chromosome. Since chromosomes are linear, one need only move from the position of the known gene until one encounters the gene responsible for the genetic problem. It's really just that straight forward, it used to take a long long time, but now the human genome has been sequenced it has become much easier, one can find all the "candidate genes" by simply looking at the DNA sequence in the computer. Of course, demonstrating the gene is the one that causes the problem is still a challenge."
Sometimes you just have markers for a particular gene. That is, if you think of a city street map, you know where the road intersections are on the map, but you don't know the house numbers in between.
Then comes sequencing. This is how you figure out the house numbers. Using special DNA chemicals that have florescent chemical tags, little chunks of DNA can be chopped and then replicated, often inside yeast or bacteria, then chopped again and chemically treated, and finally sorted by size using a kind of "jello" with electricity passing through it called electrophoresis. The electricity causes the different chunks to move at different speeds, and the florescent dye can be "seen" by a special laser. In this way, the exact sequence of DNA can be worked out. One explanation is at http://www.ultranet.com/~jkimball/BiologyPages/D/DNAsequencing.html
After the sequence is worked out, and the map is known, and you know all the streets and house numbers, then you still don't know "who lives in the houses". With the human genome project scientists have got most of the map and sequence figured out, but they have only "knocked on a few doors" to find out what the genes do.