First a confidence booster-- Zelda has a pretty good match-up against DeDeDe if you know what to look for. The first step is ALWAYS to remember that you're battling your opponent, not the character. The person will always have faults, habits, and exploits. You're looking for the ones in the person, not in the character. If you believe you can beat the person, then you'll do a lot better in the future
However, the character is a tool, and every tool has its strengths and weaknesses. DeDeDe's strengths are in his power. He can hit hard, and for a fat character, can hit pretty quickly-- more so than Bowser or Ganon by far. But he isn't fast. All of his hammer moves have lag, and a significant amount. Nayru's love is great for start up lag, if you can react fast enough, and shield drop is your ally. Guard against a big attack (rolling works sometimes too), drop your shield and you should have time for a short hop sweet spot lightning kick. Scare him away from the hammer, and you've got yourself an easier matchup.
Teledash is invaluable as well. Keep him guessing, and keep your motion up. His thrown allies (except Gordo of course) can all be neutralized in air by Nayru's pretty easily.
If you find yourself being juggled, don't panic, look for an opportunity to Teleport out of there. reset the neutral stage, and set up your din's again. It'll slow him, or possibly hit him.
Up smash is pretty good against DeDeDe, but it doesn't combo like fast fallers. Lightning Kick and Edge Guard is your best best for killing.
Keep trying Din's to edge-guard, specially tight on the ledge. You have to place it properly in the way of his recovery-- if anything it does slow him down, and give you more opportunity to rack up damage and prepare for the finishing blow.
This may seem like common sense. But it's practice that'll get it. Find your opponents habits-- try and keep yours mixed up, and use Zelda's mobility to her advantage.
Remember, you have Sheik as well.