There are two main problems with returning nets and edges. First, they catch you off guard because they come out unexpectedly in unpredictable ways. And second, there's no way to practice against them systematically.
Except . . . neither of these statements are correct. Why is that?
It is true that you never know when the opponent is going to get a net or edge, so it's unexpected, and it's true that they will come out in unpredictable ways, depending on how they hit the net or edge. But they should not catch you off guard - you should always be ready for anything. This means being in a ready position ready to react to anything, and that includes "unexpected" nets and edges that come out in "unpredictable" ways. Yes, they usually lower your chance of making a good return and winning the point, but that's no different than if the opponent faked a smash and instead did a short drop shot. You just have to react and do the best you can.
It's also true that you can't systematically practice directly against nets and edges. Note the word "directly" that I stuck in there, because you can indirectly practice against nets and edges. How? By always training to be as light on your feet as possible, in a good ready position, ready to react and move in any direction needed. This allows you to quickly react to "unexpected" and "unpredictable" shots, including nets and edges.
Now let's suppose you've trained to always be ready to react to anything, and so you managed to get to that net or edge and are about to make a return. What do you do with it? In most cases, you should focus on controlling the ball back deep on the table, ideally with topspin or backspin. You should also place the ball. For example, against a strong forehand player who likes to play forehands from the backhand side, you might fake toward the backhand side, and then just roll, push, or chop the ball to the wide forehand, catching him going the wrong way. Or if he's s slower player with a strong forehand, perhaps fake to the forehand, then return deep to the backhand. The key is depth (which makes it harder for the opponent to rip the ball, or to attack at wide angles, plus giving you more time to react to the his shot), and doing something to mess him up, whether by putting spin on the ball, placing the shot, or faking one way and going another.
And there's one other key thing to returning nets and edges: Don't Panic!!! Often players get flustered by such shots. Stay cool and react as best you can, and you'll be surprised how many points you can win off these shots. Don't worry about the unreturnable nets and edges - you have no control over them - and instead focus on the ones you do have control over, and try to win those points.