Stay on the ground as much as possible. When you get hit with a Banana it's usually because you're SH double tossing Pikmin and he's glide tossing it at your feet right as you land. If you're on the ground you can use Pikmin Toss (Side B) to stop incoming bananas as well as Forward Smash (which I reccomend). Once the Bananas are stopped Diddy will usually use a Dash Attack to pick them up or try to mindgame you into moving away from them, slipping on them, or getting hit with an aerial of his - don't get fooled. You're pretty much safe in your shield and you can punish any of his approaches that aren't banana related. When he goes to get his banana, Forward Smash him away or Grab him (I reccomend grabbing) then FAir him while hoping over his bananas that he's trying to get. Without them you can pivot grab anything he tries or just hurl Pikmin at him until he tries to make more Bananas fall out his ***.
If he tries to short hop and toss a banana you can Air Dodge while DI'ing toward it and catch it, then throw it appropriated (I usually toss down so he can't punish my landing) or Z-grab it which is when you press Z to catch the banana without any grab animation at all.
As for ledgeguard, I've seen a lot of things going on. He always tries to use the stupid side B of his to get back on to the stage so learn where it stops and have a FSmash wall waiting for him if he uses it. Because you're now a bit away from the stage, when he rolls you'll likely see it and with fast reactions you can punish it. If he jumps over the ledge you can Up Air him and gets some damage in. You might even want to try Pivot Grabbing him.
Try your best not to get Banana locked, you can shield his bananas so if needed I suggest you do it. If you do find yourself getting Banana locked, Diddy is most likely going to just throw you off stage and try to gimp you with his Peanut Gun and then ledgehog you. Don't rely on spiking him with Up B in that situation, all the Diddys I've played smash DI into the stage, tech off it, then recover anyway. I would get creative with the recover, try not to jump immediately and always be weary of a spike.
As far as killing goes for you. I think it's easy to do, especially if you get a banana. Up Smash kills him pretty quickly because Diddy's horizontal recovery is pretty good. What I like to do is mindgame them with Blue Pikmin, instead of tossing them back when you're near the ledge, Toss them up. Smarter players will DI up anticipating the BThrow but will actually die quicker cause it's really an UThrow.