I want to know how they prepared and cooked meals back then.
The answer depends on the geographic location of the house! Are you talking about a kitchen in a northern industrial city, a kitchen in a southern plantation home, or even a homestead further west?
I'll speak from my own experience - I used to volunteer at a historic mansion that dates from 1859 in the slave-holding south. In that case, the kitchen would have been an entirely separate building (usually wood, but if the family was wealthier, like in the case of the house I'm familiar with, it may have been made of brick.) Kitchens were often put in separate buildings to prevent the heat from the constantly-lit kitchen fires and the noise and bustle of meal preparation from disturbing the inhabitants and overheating the house in the summer. It also decreased the risk of larger fires. (Kitchen fires were significantly bigger, hotter, lit for longer, and less controlled than the smaller fires that would only be utilized in late autumn or winter in the fireplaces in the main house.)
In the case of a southern mansion, the food would have been prepared by slaves (sometimes with the help of servants who weren't enslaved) and brought to the basement of the house, where there would be a warming fire to reheat the food if it had cooled in the time it took to walk it from the kitchen to the main house. (Historical fun fact: Slaves were often made to whistle or sing tunes while they were walking the food from the kitchen to the house to ensure that they didn't eat it.) The food would then be brought upstairs and served to the family.
If you're looking for more specific answers about a different geographic region or more specific chronological period, I would highly recommend visiting historic houses or restored or recreated sites like homesteads. They'll give you a better idea of day to day life in the specific "type" of house you're interested in, and can answer more specific questions about kitchens and food.
You can also look into cultural histories that might deal more specifically with food culture and kitchens in the specific era or area you're interested in. Based on a cursory search of the internet, I've found a few scholarly text available online that might be of interest to you, particularly, "Never Done: A History of American Housework" by Susan Strasser. If you're not willing to tackle books, you can also use article databases like JSTOR and ProQuest to find articles about the specific American kitchens you're interested in.
Catharine Esther Beecher was an early social activist. In addition to being one of the early advocates of kindergartens, she also published a great deal about home economy, thrift, hygiene, etc. Probably her best known book is A Treatise on Domestic Economy for the Use of Young Ladies at Home and at School(T.H. Webb & Company, Boston. 1843). The book includes a number of designs and diagrams for a well laid -out kitchen, and a wealth of other information about domestic technology in the mid-1800s.
She also published, with her sister Harriet Beecher Stowe (yes, that one), a book called The American Woman's Home: Or, Principles Of Domestic Science; Being A Guide To The Formation And Maintenance Of Economical, Healthful, Beautiful, And Christian Homes(H.A. Brown & Co., Boston. 1869). In this book they focus very heavily on design and technology. Both of them are worth a look, remembering that they describe (or urge) kitchens that are quite idealized.