Do we clearly know what the living closest relative of the dinosaurs are? And connected to the first question, in scientific manner how do we know these relationship between extinct species and living ones?
In general the answer is always the same: you construct a phylogenetic tree. In order to locate different species on this tree in relation to each other, you use various features to compare which species are more similar to each other than others.
The best way of doing this is by comparing their DNA sequence, especially orthologous genes (i.e. genes common to the species compared).
Unfortunately, genetic sequences usually aren’t available for extinct species. You can still compare homologous features though. For instance, the class of mammals are all characterised by the possession of mammary glands. Similarly, all vertebrates have a vertebral column and all aves are feathered, warm-blooded, egg-laying vertebrates.
The collection of many such features from fossile records allows the creation of more or less detailed phylogenies. The Wikipedia explanation mentions several transitional fossil forms which trace the evolution from dinosaurs to modern birds via several intermediates. All of the inferences are based on anatomical resemblance.
This may sound weak evidence but in fact anatomical homology has proved to be sufficiently accurate in constructing other phylogenies, where we have been able to verify the correctness using genome comparison data. So while there is much uncertainty about the precise branching point of birds from dinosaurs (or maybe archosaurs), there is near-certainty that the common ancestor of birds and dinosaurs was, in fact, an archosaur.
Extending Konrad Rudolph's answer, research has been conducted into reconstructing the phylogenetic tree via protein sequence data of the T. rex (one of the latest living dinosaurs):
They use a variety of standard methods for the phylogenetic analysis. The real challenge was collecting protein sequence data for the T. rex (which has been extinct for ~65 million years). They succeeded in collecting and sequencing collagen α1(I) from Mastodon and T. rex, and compared it to the same protein in extant species.