The first thing to know is, we have one of the best recoveries in the game. We can literally be an inch away from the lower blast zone, use our second jump, up-B, and directional air-dodge upward and get the ledge. Most of the time you don't need to use the second jump or air dodge, even if it looks like you're too far away. Also, our up-B hitboxes have priority/invincibility over pretty much every move in the game. So don't be afraid to be aggressive off-stage. You will be able to make it back 99% of the time, even if you d-air off-stage.
If your opponent is coming from the side, try to determine two things– have they used their second jump already, and have they been recovering using a side-B or an up-B (i.e. a lot of Fox/Falco/Wolf players use side-B to recover). If they haven't used their second jump and they clearly need to use it to get back (i.e. Ganondorf, Belmonts, swords, etc), get over there quickly and hit them either just before they use the jump or a few frames after they use it, before they can use their up-B. If they've already used their second jump, their options are really limited, so take advantage of the weakness of their side-B or up-B. Almost all side-B's will lose in priority to our b-air, and they all lose to our d-air and up-b. Against a character with a horizontal recovery, f-air and up-B are our weakest options.
If your opponent is recovering from the bottom and away from the stage, they're in trouble. We can fast fall to b-air, which will kill at early percents, we can jump off stage to d-air, which will possibly knock them to the side blast zone or result in a stage spike, we can drop bombs with f-air and, though it isn't used often enough, use the frying pan offstage to send them into tumble at a downward angle, killing instantly. Basically, depending who your opponent is and how well you know their recovery options, we have something for everyone.
If your opponent is recovering from the bottom and likes to hug the bottom of the stage (KRool, ROB, Isabelle, Plant, etc) they are also in trouble. First of all, these recoveries are really predictable and they are usually vulnerable the entire time. We can stage spike them with b-air, up-B, n-air, and if you have a full bucket, this is actually a great time to use it since they can't dodge– they MUST get back onto the stage or die. Lots of decent players have a bad habit of exploiting their recoveries to distance themselves... against G&W that's asking for trouble.
There are a few characters that are more difficult to edge guard against (generally any character that has lots of jumps except DDD who is a big and easy to hit) but in general, if your opponent is hard to trap with a d-smash, killing them from off-stage is the way to go.
edit: forgot to cover what to do if they are coming back from the top side corners. There's two options: if they're at high enough percent, try to angle up-B so it kills off the side, OR simply use your double jump and bait them into airdodging. As soon as they air dodge, you've got a few options. Usually the most effective way to punish is to follow them to where they're landing and f-smash since it has better range than u-smash and higher knock back than d-smash.