The majority of mushrooms (fungi) are detrivores, meaning they consume dead organic matter. A large part of these also form mycorrhizal associations with plants, meaning their hyphae invade the plant root tissue and exchange nutrients (they supply for instance phosphorous and the plant supplies carbon in the form of sugars).They're thus very beneficial and and important part of a healthy soil biome.
Only a handful are parasitic or damaging to plants.
As for humans and other animals...not directly (aka don't consume; only do so if you're 110% certain).