Birds are descendants of dinosaurs. To understand how birds evolved from dinosaurs you must first understand how bird like features evolved and developed such as feathers, flight, toothless bills, hollow bones, and many others. I will try and provide a basic overview of some of these features.
Evolution is not goal set and therefore flight is only a secondary feature of feathers. Feathers must have evolved for another reason. The two main ideas on feather evolution are "Scale to feather" and "Evo devo" of which wiki may help you to understand. Whichever way they developed flight was not the reason. Feathers may have evolved for camouflage; we know that many birds are hard to see against their backgrounds. The problem with that is there is no reason why skin wouldn't provide an equally good camouflage. Another possible reason is for insulation, which prevents over heating during the day and retains heat during the night. Another good possibility is that feathers developed though a form of sexual selection; feather like ornaments were attractive and therefore selected in mates.
Archaeopteryx could have been one of the first animals to develop flight. It had a small keel, so would have poorly developed flight muscles. It has asymmetric vanes on its feathers showing that they would be capable of lift. It lacks an alula meaning that its landing would have been clumsy. This "bird like" ancestor could have developed the basis of flight though either of two main models, arboreal or cursorial. in the arboreal (tree) model this ancestral theropod lived in trees and could jump tree to tree, this would be aided by its grasping toes, reversed hallax claws and long tail. Gliding from tree to tree would be aided by elongation of feathers. Flapping would further aid moving from tree to tree. In the cursorial (ground) model the ancestral thereof would chase after its prey. Extended forelimbs would increase balance during leaps for prey. Elongation of feathers would increase range of leaps. Flapping would further this more.
Bills/beaks provide advantages over normal mouths in a few ways. Bills may be better at extracting food from different sources. Darwin's work on the Galapagos shows how different bills have evolved to provide different functions. When extracting food from an abrasive source such as rocks or wood it would help to have solid mouth parts. Lips are delicate and would not last long as an extraction tool from these sources.
Hollow bones allow longer easier flight. Ancestral birds that had lighter bones would be able to glide longer than those with heavier bones. Evolution would select these lighter individuals.
I have missed out some important features such as thermoregulation, but I hope I have provided a good basis for some of the important stages in evolution. Birds are just highly evolved dinosaurs.