its harmful to eat not very well cooked beef?
I am not a doctor, and this is not medical advice--just my view of the current best practices recommended by sources I trust.

It depends on the kind of bacteria or parasites commonly found on the food in question. Chickens are often infected with Campylobacter or Salmonella, and those bacteria can get into the flesh of the meat. So cooking chicken thoroughly is strongly recommended. And in my opinion, raw chicken isn't that palatable anyway so there's no reason to take the risk.

It used to be common for pork to be infected with Trichinella (a parasite) which also made its way into the meat, so it was recommended that pork be cooked well. Nowadays that's actually pretty rare, and you can even find irradiated pork that is free of parasites and thus safe to eat semi-rare.

Fish harbor parasites. Sushi bars kill them by hard-freezing the fish to kill the parasites before thawing and serving the fish raw (at least in the US--Japanese often just take their chances). It is not recommended that you try this at home--cook your fish thoroughly and save sushi for a night out at a bar you trust.

Beef contamination (such as E.Coli) is generally found only on the surface of the meat and not on the deep interior. So a steak well-seared on the outside and rare in the center is generally safe (and delicious--rare beef is juicy and flavorful while well-done beef is leathery and bland). Grinding moves all that surface around, so ground beef should be cooked well, unless you take special precautions like irradiation or sear-then-grind.

Lamb is similar to beef but current recommendations are to cook to 145, which is distinctly medium. I personally like my lamb a little pinker than that, but that's my choice--I don't have a lot of information on the specific risks there.

Fruit and vegetables are similar to beef, in that contamination is generally found only on the outside. Some are washed with chemical disinfectants; others can be simply peeled. Pre-packaged pre-cut fruit mixes and salads are notorious for being overhandled and contaminated by grocers. Buy whole, and make the salads yourself.

If by "very well cooked" you mean "charred to death on a grill", there is some evidence linking over-charred meats to some cancers, but it's not definitive at this point.

Of course nothing is completely safe, and food-borne illness can happen regardless of best intentions and practices. You must decide your own practices based on your health and level of comfort.