Well, I've always found that raising the stakes in general makes a story have more gravitas. So, okay, Team Rocket is stealing pokemon to resell on the black market. That in and of itself is a pretty grim prospect, but say they were using their profits from that enterprise to smuggle enriched uranium and fund R&D on a weapon of mass destruction that they are prepared to use on a powerful governing body. This turns Team Rocket from a shady mafia into a very dangerous terrorist cell. And now say your protagonist has managed to infiltrate the ranks, but not before whoever is in charge of the launch has started the countdown sequence. The protagonist cannot stop it, only change the coordinates of the missile. They could stand back and do nothing, or they could detonate the weapon inside the Rocket base, destroying the organization but at the same time themselves. Or, they could attempt to launch it somewhere else, where perhaps there might be less casualties or ecological damage, though with no guarantee it will work.
Another way to make a story darker is to add internality and personal moral or psychological struggles. Perhaps a character is dealing with a mental disorder, or fighting off a growing madness. The well-intentioned extremist villain might discover that they are dying of a terminal disease, and since they have nothing left to lose and only a little time left, seeing their utopia come to fruition before they die justifies the means that they use to achieve it. Or maybe, your protagonist tries hard to be good and virtuous, but their circumstances force them to make difficult, perhaps amoral, choices. The way to making a story darker and more serious is to give the characters and plotlines realistic depth and consequences.
I would consider dark any story that has a good moral quandary, and no clear cut solution. That, or characters who are sufficiently well rounded and flawed (especially flawed). A story that has no "good" side and no clear-cut "evil" side often leads to a "dark" story. A twist like the protagonist actually playing into the evil chessmaster's plan all along and bringing about the very thing they were trying to avert, or a similarly soul-crushing reveal help as well. Classical tragedies (like Macbeth, Hamlet, the Illiad, Les Miserables (arguably), Antigone and Frankenstien) are great examples of dark stories not because of the high body counts (okay, in Les Mis's case it's exactly because of the high body count) but because they wrestle with large ideas and force their protagonists to take sides on difficult issues that end up dividing them and forcing them to do things they might in other circumstances consider unthinkable. Macbeth is a sterling example of a classically "dark" story, because it combines violence and bloodshed with psychological trauma and intrigue. We watch as Macbeth changes before our eyes from an honorable man and a war hero to a villain protagonist and ultimately, a complete monster.
There are plenty of examples of good dark stories, but I think a way to do it wrong is to get too wrapped up in trying to make your story dark. I mean, you could have an axe-wielding psychopath murder everyone your protagonist loves before their eyes and leave them sobbing and awash in the blood of all they held dear. And while that's a gruesome image and understandably awful, without properly setting up this axe murderer as a threat and giving it some kind of background, I just kind of feel like it falls flat. I recognize that Edgar Allen Poe is a terrific writer with a brilliant grasp of language, but I really don't like The Fall of the House of Usher or The Tell-Tale Heart. I think he's just trying too hard to make something dreadful. Both of them are a little too over-the-top for my tastes. I have the same issue with a lot of horror movies. They just try too hard to be dark for darkness's sake.
You need to plan out just about everything if you are aiming for a dark story (well, any story for that matter) all while you keep the characters in character.
I would respectfully disagree with this. As a writer who does only minimal planning when writing, and as one who has dealt with dark themes on multiple occasions and dealt with them (in my own opinion at least) rather well, I don't think planning is as necessary as you make it out to be. Granted, if you are writing a psychological thriller or writing about a mental illness, I would advise you put in the requisite research beforehand so you know what the bloody hell you're talking about. But I tend to allow my plots and characters to grow organically, and they mature like wine as the story goes on. Some dark themes I didn't intend originally including find their way in, and experiences I put my characters through lead me to start developing them in different ways. Sometimes the best way to let something grow is to simply tend the seed.
Ultimately I have this to say: if you're a novice at writing, don't worry about making a story "dark". Just focus on writing a good story. In time, as you grow as a writer, you will also grow and develop as a consumer of media and stories, and you will learn how better to handle these dark themes and plotlines. Eventually, you'll just start writing in deeper and darker plotlines because that's what you've grown into. Kutie Pie had the right of it, this isn't an easy thing to explain (especially when the OP is so broad about it), because it's just something people
do subconsciously. I had to write a novella for one of my classes last year, and a character I had originally intended to be kind of an ace and generally a folk hero archetype actually ended up as a damaged widower who was dangerously unstable and a serial arsonist using a freedom fighter movement to justify his actions. It was only in the retelling of his story by his surviving comrade that made him into a folk hero in the eyes of his people. I didn't originally intend for this character to have all that baggage, but... well, it just sort of happened. I can't explain why or how, but I knew it would make for a more interesting and compelling story, so that's just what happened.