Epidemiology originally largely meant studying how infectious diseases spread, and that's still a major concern of epidemiologists. However, it also includes the study of any and every environmental or behavioral factor affecting human health. For example, the finding that smoking tobacco causes lung cancer (not to mention a bazillion other diseases) is an epidemiological finding.
Epidemiology is largely an observational science, given the ethical prohibition against exposing humans to potentially hazardous conditions for experimental purposes. That's not to say it hasn't been done, with the victims being especially vulnerable people, but it's no longer condoned. And given the complex associations and interactions among elements of the human environment and behavior, it is usually very challenging to convincingly establish causal relationships. That's why the tobacco companies could hold out so long against the conclusion that their products were deadly, although truth be told they continued to deny it long after they knew it to be true.
There are just a few basic epidemiological study designs. They differ in time, cost and inferential value, so investigators have to balance the tradeoffs among these. The original finding of a link between tobacco and lung cancer was based on what's called a case-control study. The investigators found a bunch of people with lung cancer, and people without lung cancer who were otherwise similar in age and gender. Then they asked them a bunch of questions about their past behavior, including their smoking history. The association was striking: almost everybody with cancer was or had been a smoker, while the prevalence of smoking among people without it was much lower. The probability of this occurring by chance was infinitesimal. But . . .
This did not prove that smoking causes cancer. The reason is that there might be some other factor, that the researchers didn't think to ask about, that is associated with both smoking and cancer. You can try to control for the factors you did ask about with various statistical techniques, but that gets complicated and there is often room for argument. Another possible objection is that people with cancer, who think smoking may have caused it, unconsciously over-report their smoking history. (Self-report bias is often a big problem, although it's a fairly minor one here.)
So putting the nail in the coffin of coffin nails required more. Animal experiments showed that tobacco smoke causes lung cancer in rats, which helped. There were larger case-control studies that asked more questions. There were prospective cohort studies. These are more powerful for causal inference, but they take a long time -- decades in this case. Basically, you follow a bunch of people over the years, and you frequently get information about their behavior, environment and health. You can reliably ascertain who starts smoking and when, and compare their health to that of nonsmokers over the years. The so-called Framingham Heart Study, which has now gone on for generations, is probably the most famous example.
So, I can tell you as certainly as I can tell you my name that smoking tobacco causes lung cancer, heart disease, strokes, other cancers, chronic obstructive pulmonary disease, and a whole lot more you want no part of. So don't do it.
However, one area where there is serious controversy is nutrition. People get very annoyed, in fact, because the official nutritional advice has often changed over time. Among the many difficulties in nutrition research is getting accurate reports of what people eat. Most people don't remember what they had for lunch yesterday, let alone are able to give an accurate accounting of their entire intake for the past month. Diet is also inextricably linked with other characteristics of people, from income and social class, to ethnicity, to physical activity level, alcohol intake -- all sorts of confounders.
For a long time, a low-fat diet was promoted as healthy. Nope. In fact fat is good at slaking hunger, which means having it in your diet makes you less likely to overeat; and it doesn't cause the glycemic spike you get from starches, which creates risk of diabetes. So then they decided that it's not how much fat you eat, but what kind of fat.
Without getting too much into the chemistry weeds, edible oils are long chains of carbon atoms with hydrogen atoms attached, and what's called a carboxyl group on one end. Since carbon has a valence of four, each carbon atom (except for the ones at the ends) can have two hydrogen atoms attached, the other bonds going to their neighboring carbon atoms. If every position is occupied by a hydrogen atom, it's called a saturated fat. Animal fats, generally, are saturated. But if two adjacent carbon atoms have a double bond, they'll each be missing one hydrogen atom. If this happens, it's called an unsaturated fat. In nature, almost always when this happens the hydrogen atoms adjacent to the double bond stick out on the same side. This is called a cis fat. But if they stick out on the opposite sides, it's called a trans fat. Although trans fats are rare in nature, they can be manufactured, and food companies liked them because they don't go rancid. They also tend to be solid at room temperature which is useful for some purposes.
Okay. To make a long story as short as I can, food scientists first decided that saturated fats are bad for you. They even promoted margarine -- a trans fat -- as a healthier substitute for butter. Whoops! It turns out that trans fats are the worst thing you can eat. They raise the bad kind of cholesterol and are associated with cardiovascular disease. Ultimately, the FDA banned artificial trans fats from the American food supply. (There is a small amount of trans fat in beef and dairy products, but it hasn't been found to be associated with disease.)
However, for a long time scientists still insisted that saturated fats are bad, and we should be eating unsaturated cis fats, which are various vegetable oils. There were more specific theories, such as omega-3 fatty acids -- with the carbon double bond in the third position from the tail -- have beneficial properties ranging from protection against heart disease to anti-depressive effectiveness. Right now, this is looking not so true after all. Saturated fats aren't so bad for you, and omega-3 fatty acids don't seem to have any super duper properties. (The idea that they do mostly came from their high prevalence in fish, and diets with a lot of fish do seem to be good. However, that doesn't seem to be the reason why after all.) There are other good reasons to reduce the amount of meat in your diet, but that doesn't seem to be one of them.
I won't get into any further discussion of the USDA nutritional recommendations. I do believe that high fiber diets are good, and that means whole grains. Veggies are good also, both for fiber and micronutrients. But are the proportions they recommend exactly right? That's really unprovable. Happy to see debate about this in the comments.