Games are generally supposed to be challenging. But there are many different ways to achieve difficulty, and some lead to more frustration than fun. Here I'm going to talk about some bad ways to achieve difficulty. (Note that I'll stick to action games for the most part.)
Increasing the punishment for making a mistake. For example, a bad designer might pit you against enemies that kill you in one hit, while you need several hits to kill them. But this is a very frustrating form of difficulty. A better idea would be to make the enemies do less damage on a single hit, but make their attacks harder to dodge, so that the player gets hit more often. It's still equally hard, but it feels better because you're not being instantly killed by a single mistake. No one likes not being given a second chance.
Inversely, making enemies hard by giving them too much health is a bad idea. Repetition is boring. We can all agree on that. And giving enemies enormous health bars leads to repetition in two ways: not only does it force the player to tangle with the same move pattern for longer, but also it means more lost progress if the player loses. Instead, make the enemy more dangerous while you're fighting them, but don't force the player to do it for as long.
Making the controls hard to use. For example, requiring the player to rotate a thumbstick more than 90° but less than 180°. It's fun when you lose a fight because you weren't skilled enough, but it's not fun when you lose a fight because your finger movements weren't exact enough. One of the main advantages of video games over sports is that they make your real life body not matter. We need to capitalize on that advantage.
Expecting the player to know something they have no reasonable way of figuring out. Common forms:
Enemies that kill you with an attack you didn't know they could do and couldn't have reacted to properly without being already familiar with it (parrying in Dark Souls).
Super secret preconditions that must be set up to remove a boss's near-invincibility (Mytha the Baneful Queen, from Dark Souls 2).
You fight two bosses at once and focus your attacks on one of them only to find that if they don't die at the same time the remaining one heals the dead one to full health (Throne Watcher & Throne Defender, also Dark Souls 2).
Punishing the player for dying. As if having to restart the level wasn't enough of a punishment, some designers feel the need to do things like not return consumable items used on the last try, shrink the player's health bar each time they die (Dark Souls 2), de-level the player's character, or similar. All these mechanics are completely unfair and just bullshit. The game should not get harder when you lose, for god's sake! It does not take a genius to figure this out!
Now that we've been through all that, you might be saying, "But Yujiri, you just crossed out almost all the possible ways of making a game harder! Is making the enemy attacks harder to dodge really the only thing I'm allowed to do?". No. In fact I only even mentioned that first because it was such a direct replacement for what I was suggesting it be used instead of. Obviously, the #1 best way in pretty much any type of game is to make the enemies smarter. But that's very hard. Most RTS games get as far as the second-hardest difficulty using this alone and then for the hardest one give the computer a ludicrous resource boost.
So besides those two, there's also another method that has serious potential and almost nobody seems to use: making the game run faster. Faster game speed forces the player to think faster as well as time button presses more exactly. In particular Dark Souls was the perfect game to make use of this mechanic. Skilled Dark Souls players have sometimes completed challenge runs of the game with a level 1 character and without dying or similar restrictions. The game could have been a lot nicer for those players by just including speed options so they could raise the difficulty without having to self-impose badly designed forms of it. Of course, if you go too far with this you might run into performance limitations, depending on the platform and the game. I don't have the information to know if that was a legitimate excuse in Dark Souls's case.
Also, I should point out that artificial or numeric difficulty (the first two points I criticized) are only bad in excess. Making the enemies too statistically weak can actually be a flaw of its own.
Strategy games do warrant some discussion. For asymmetric strategy games where you need to go harder than your AI coding skills can achieve, one thing you can do is make the AI predictable. If the game is possible because the AI is stupid, that's inherently kind of lame, but if it's at least stupid in predictable ways, then the player can exploit it, creating more room for skill and allowing you to get away with a higher degree of numeric difficulty.