The Sheik matchup is not in your favor specifically because of the strength of her punish game against you. Do not get grabbed for the love of all that is sacred
There's probably a flowchart out there somewhere for the optimal DI and defensive options once you get dthrown, but I don't know where. Just avoid it. The idea with Sheik onstage is to get her above you, usually with uthrow. You don't have anything as guaranteed as a chainthrow, but she doesn't have very good horizontal air-steer, and her priority is drastically diminished when she's above you. Techchase at early percents, then start uthrowing her, observe where she's going/teching, and react with a well-timed utilt, uair, regrab, or fsmash, depending on the situation.
Sheik's approaches are actually somewhat limitted; she has dash attacks some decent tilts, grabs, a much less useful dash-dance, and too high of a short hop to make aerials all that safe or effective. The trouble from neutral is that she has needles and can force you to approach her, to an extent. Sheik, as a character, relies on punishing mistakes hard. Her dthrow is one of the most brutal throws in the game considering the follow-up she gets from it, she has auto-combos into kill moves, and she has an arsenal of gimping and edgeguarding tools. Basically, the gameplan is to put enough pressure on Sheik that she can't use projectiles safely, but to keep enough space that she can't jump you before you can react. It's a delicate balance to strike, but you do have a sword, which makes things a little easier.
Since Sheik punishes hard and Marth can't approach all that well, you personally are swinging too much from neutral, but you're especially throwing out too many nairs. You don't have to swing your sword every time you're free to do so; throwing moves like the nair out, even if you successfully cross up a shield, risks getting punished hard without even giving you much follow-up. Wavedash-dtilt is a far safer approach option in just about every situation, and half the time you should be repositioning and threatening space instead of even doing that.
Wavedash more in general, and if you're not comfortable doing that, practice it on your own until you are. Wavedashing allows you to make short spacing adjustments to threaten space, retreat, move in for follow-up hits, and more without sacrificing the options you lose by dashing somewhere. You should also put in work so that you can wavedash to the edge, and after you get that down, work on wavedashing off and fastfalling so you grab the edge even faster (it's precise; you have to let go of the control stick pretty quickly so you don't hold down too long and tell your character to drop past the ledge). Edgeguarding Sheik is much easier when you're able to grab the ledge in time. As long as you make sure you're invincible during the hitboxes of her up-b, you can force her to land on stage with enough lag that you can knock her back off again or at least punish her pretty hard. You can also mix in surprise drop-off double-jump backairs, though you need to be careful with those. It may take some time, but if you're patient and react well, you can actually get some pretty reliable kills with edgeguarding.
That's a lot. Hope you find it useful.