Gordo, Gordo, and more Gordo.
Dedede doesn't really have a go-to answer for covering ledge options. A well-spaced ftilt can cover neutral get-up and attack, down smash is great for covering rolls, you can demolish ledge jumps with fsmash, it's mostly about placing yourself in the right space at the right time with the right attack.
Gordo is helpful when doing this because it makes your opponent afraid. It covers neutral get-up and some other options, depending on where you place it, and you can be prepared to reflect it if they choose to do a get-up attack. If they get-up and shield instinctively, the Gordo has enough hitlag on shield that you can do something to pressure their shield, such as a smash, grab, or inhale. Many people like to roll past Gordo, which can be met with a down smash. And if they hang on the ledge too long, you can run off and do nasty things to them...sometimes the Gordo will even stage spike them for you!
The other thing Gordo is good at is eliminating ledge as an option all together. It's tricky when using defaults, but sticking a Gordo to the side of the stage can cover low recoveries, and when it's right smack dab on the ledge it covers basically all recoveries. It's not that bad of an idea to go for every now and then, as a Gordo stuck to the wall will pop them up into the perfect spot for an fsmash to come crashing down on them. Additionally, you can always try to intercept certain recoveries with Gordo that don't have a hitbox. Sometimes it will rebound off of the opponent and stick on the wall, putting them in a seriously bad spot.
If the Gordo fails to stick to the wall, it will rebound off of it instead. Again, this is good to try against recoveries like Falcon's or Duck Hunt's, because the rebounded Gordo can nail them on its way down. It's all about knowing you character and your opponent's when it comes to using the Gordo.
If you meant to ask about how to get up from the ledge as Dedede, well...his options are unfortunately pretty easy to cover because of his general slowness.