What was the reaction of the public or the scientific community when the first dinosaur fossils were discovered? Were people shocked? Or was the discovery more gradual by find bits and pieces first before a larger fossil was found? Was it theorized that large creatures once existed before the first fossils were discovered or did the discovery come out of nowhere?
Very curious as to how people felt. Even today it seems almost fantastical that dinosaurs once roamed the earth.
It was more of a gradual thing. I'll begin with the inception of palaeontology and the concept of extinction, since this shockingly only actually happened a few decades earlier. It's a bit unfathomable today but it wasn't until the mid-1700s that the very idea species could cease to exist was scientifically entertained. This was a time in which science still had ties with religion (since essentially all scientists were religious), Linnaeaus' classification of life was hot off the press, the world was considered to be only thousands of years old, evolution was just beginning to be considered (Darwin's theory of natural selection is about a century off); for reference this is around the time of the American Revolution, and a little over a century after the extinction of the Dodo.
The idea that animals could go extinct itself was rather gradual. Nicolas Steno had shown that fossils were really the remains of dead living things at the end of the 1600s, so it was only a matter of time people started wondering if some of these things really fit living boxes. Perhaps the biggest player in this respect was the discovery of American mastodons, but since Manifest Destiny wasn't really a thing yet (Lewis and Clark's expedition wasn't until the start of the 1800s, Mastodon's history starts in 1705) it was still on the table some sort of elephant beast really was out of there in the wilds. Mammoth tusks in Siberia were in a similar situation. Then, in 1789, we found Megatherium.
Megatherium - the giant ground sloth - is a rather hard best to swallow as "we just haven't discovered it yet". Importantly, from its bones was made the first mounted fossil skeleton, allowing the top minds of European science to witness it first hand. Led by Georges Cuvier, later seen as the father of palaeontology, the idea organisms could go extinct was gaining popularity, scientifically.
Already there were hints of an age of reptiles, but the idea hadn't quite come together for a while yet. The pterodactylus was found sometime in the 1770s or 1780s but it was so weird nobody really knew what they were looking at for the better half of a century. The gigantic marine lizard Mosasaurus turned up as far back as the 1760s and more remains were found over time. Mary Anning brought fantastic specimens of similarly marine plesiosaurs and ichthyosaurs to the table over the 1810s and 1820s onwards. It's on this stage of mysterious ancient reptiles we meet up with the dinosaurs, who as you may observe were late to the scene.
The first named was Megalosaurus, who remains had turned up since the 1790s. Nobody was really paying them mind before its naming in 1924 though, and one must stress we're not talking about beautiful specimens like with Plesiosaurus. No, these were a handful of scraps, which is all we'd have for a few decades. Iguanodon and Hylaeosaurus followed, and in 1841 Richard Owen - the biggest player in Victorian palaeontology - united them as dinosaurs. The other big name to follow here is Giddeon Mantell, who discovered Iguanodon, if you're looking to read into it on your own. For reference, the best dinosaur specimen known to science until Scelidosaurus in 1859 was probably this thing.
You may note I haven't mentioned the public yet, because there's really not much to say. The practice of public exhibition of dinosaurs was extremely rare in the 1800s and this is why Megalosaurus is at best a tertiary figure in popular consciousness, while Tyrannosaurus from eighty years later takes top spot. This said, two major exhibitions did exist in the 1800s; the first was the Crystal Palace sculptures. Curated by Owen, it displayed the original three alongside various other extinct organisms. They've aged like milk, but I'll let Mark Witton talk about that. So far as impact goes, they appear to have had a limited effect, as did the other exception, the 1868 mounted skeleton of Hadrosaurus. This said, they obviously did something right, seeing as they were by far the poster children of the now recognized reptilian age, both scientifically and publicly.
As I mentioned we'd by now dug up Scelidosaurus and then in the 1870s we found a ton of great Iguanodon skeletons in Belgium (these actually turned out to be totally different from the original Iguanodon, but the original fossils are so poor we threw them out and tied the name to these instead), so we're finally getting good remains to work with. We also start to really expand the American scene, which first appeared with a few shitty teeth named in 1854. The likes of Brachiosaurus, Diplodocus, Triceratops, Stegosaurus, Allosaurus, and Brontosaurus are all named around this time, but again a lot of the initial specimens were pretty garbage, replaced by much better ones later on. There was still no interest in public exhibition, since instead dinosaur palaeontology was dominated by Othniel Charles Marsh and Edward Drinker Cope, who partook in - I kid you not - "the bone wars", wherein they competed to be the best-est scientist and name the most species which devolved into a bunch of random fragments of fossil being assinged a name off of dubious anatomical distinction. Hilariously petty but dry in regards to the details and not good at producing great museum material. For the record, Marsh overwhelmingly did better at naming lasting taxa with decent material.
It was in the early 1900s after both Marsh and Cope kicked the bucket (as had Owen) that an interest in museum display hit the scene, and Henry Fairfield Osborn won the race with his display at the American Natural History Museum in 1905. It's this exhibit that truly solidified dinosaurs in the popular consciousness and that's why the dinosaurs from it - like Triceratops, Tyrannosaurus, and Brontosaurus are the most popular today, albeit with a later contribution from other museums and of course Jurassic Park.