There are good points in DMGregory's answer. I especially like the one where a win/loss is split into multiple minor wins/losses, which is taken from slot machines - when in doubt copy slot machines, because they're the ultimate game where (almost) all players lose, yet so many continue to play. Let's add some more points:
Use gamedesign to allow victories, even in defeat.
Ideally, an overwhelming one-sided victory should be very rare. So in a hockey simulation the loser can try for a consolation goal, in a strategy game they may want to at least take out a certain unit. In Titanfall there are super weak bots in every match so the player could at least get some kills. You can also leave the definition of victory open, such as in 8 player free for all deathmatch, where first place is so unlikely to achieve people don't expect to get it. That way weaker players can set their own targets, such as not being the first to die.
Use statistics to allow players to feel a sense of accomplishment after a loss
At the end of the game you offer statistics, like in HotS where you can see who made the most kills, dealt the most damage, the most other kind of damage, absorbed the most damage, died the least, contributed the most xp, healed the most, assisted with the most kills, etc. That way even if the match was lost, it is rather likely that you'll be best in some statistic. In Starcraft there is even a mark next to every statistic in which you played better than your average.
Players must stand a chance in PvP
Matching new players against the top players in pvp isn't fun for anyone involved. The challenge needs to match the players' level of skill, so in PvP you need a system that guesses a player's strength and (a) prevents totally unfair matchups and (b) provides a minor advantage for players suffering from a loss streak. (b) is key, because losing 10 times in a row can make players quit your game permanently.
Provide the option to train basic skills without losing
If there is any skill involved, players need to have an opportunity to train that skill without losing all the time. For example, people who have never played an fps will not stand a chance in a pure PvP game like the recent Star Wars themed Battlefield game - they would likely die more than 100 times before making their first kill. Even in a 100% multiplayer game, there needs to be an option to train against non-human opponents, no matter how dumbed down and basic it is. In Battlefront they solved this with a simple mode where they just spawn waves of weak enemies, in other fps games they solved it by adding a single player campaign, or by allowing to play games with or against any number of bots.