This topic is covered unusually well by other sites, but I'll cover it here, briefly.
If things are too predictable, players can simply solve your game. That's no fun. Things should be somewhat uncertain.
A good designer adds uncertainty, by using interlinking, hidden information, by and adding interaction between components or players. This makes the game too strategically complex for the players to solve. A player is not entirely certain what they should do, so they need to think about it.
A bad designer just throws in randomness, to create the uncertainty. It does the job, but with a host of downsides — it's often feelbad, disruptive, and anti-meritocratic.
If you're looking for a way to resolve combat or some other small test, use hidden information, not just randomness. If I attack you, I don't roll a die. Instead, you may play a shield card from your hand.
You want players to have some ability to deduce or reason what's going to happen — not total ability or inability.
Input randomness gives people randomness, but then lets them do something with it. The most common kind is simply drawing cards. You get random cards, but then you get to use them as you wish, and they have their non-random effect. This allows the player to strategise, and do meaningful things.
Output randomness means that you make your choice, and then the randomness occurs.
In Monopoly, a player draws a card, and something happens immediately. There is no strategy, just random surprise.
You can use output randomness, but try to remove "bad" outcomes. The best output randomness gives different and interesting results, not good and bad results.
In one of my prototypes, there was very clear output randomness. You could try to use a skill, like Climbing. You'd roll a die and add your Climbing skill score. If the total was high enough, you succeeded. However, if you "failed", you learned from it, and your Climbing skill score increased by one.
Multiple playtesters of the Radlands expansion submitted the "crazy hospital" card idea. This thing might heal your person, or it might kill them. Wacky! This output randomness was really un-fun to play, and out of place in Radlands. I eventually made a version which healed your person if successful, but gave you a refund, and turned your injured person into a punk, if it failed. Punks are okay, so everyone was happy to try out this card, because there was no real downside.
If some results are better, make one or two outcomes stand out by being good, while the rest are mediocre. Don't have any "clearly bad" outcomes.
Even if you have good and bad results, avoid making them "strictly worse" results. This is where one result is equal or better in every way. Three goats might usually be better than two sheep, but three goats is strictly (always) better than two goats.
Randomness has some very positive attributes, and most games can benefit from a small amount of it.
Randomness makes each game different.
Chess starts out exactly the same each time, which is less interesting, and allows players to memorise opening sequences.
Randomness means a weaker player has a chance of beating a better player. This means that every game is a serious competition.
I'm an excellent Scrabble player, but anyone could beat me.
Randomness is exciting. Randomness is generally maligned in strategy games, but some games are about the surprise and excitement of randomness. For fun and light-hearted games, randomness is entirely appropriate. Also, if there's constant randomness, it tends to even out.