|Wildebeest are grazers - note the squarish muzzle|
Although the same can be said of fossil mammals - especially the stranger ones - in many cases, we can be more confident that our educated guesses are likely to be accurate. For example, sabre-tooth cats were, well... cats. So we can look at, for example, the proportions of their limbs, compare them with living cats, and deduce whether they were more like, say, jaguars, than they were like leopards. Because leopards, jaguars, and sabre-tooths are, in many respects, quite similar, it's pretty likely that inferences drawn from the first two will apply to the third, unless there's some good reason to suppose otherwise. We know what cats are like, and sabre-tooths were cats, so that tells us a lot.
And what about herbivores? Herbivory includes a range of different diets, such as animals that feed mainly on seeds, or fruit. But large mammalian herbivores tend to have two possible feeding strategies: grazing and browsing. The best way to tell the two apart would be by examining their dung, and, failing that, the structure of their digestive systems could well be helpful. Neither, of course, are possible, if all you have is a fossil skeleton, but, fortunately, there are other clues we can examine.