Step one of fighting Yoshi is knowing the "cheese" yoshi players like to go for and how to deal with it. There's the obvious stuff like neutral b at ledge to egg trap you offstage, but also Yoshi's tech chase setups, down b shield breaker/down b kill confirms, etc. You make the matchup 10 times harder for Yoshi if they can't take early stocks.
Step 2 is knowing what is safe and what isn't with Yoshi. Alot of Yoshi's kit looks safe, but actually isn't very safe at all. Alot of people get salty over Yoshi's dair, even though it's very unsafe on shield. Remember to shield all the hits if you can without getting shield poked and punish with up b out of shield. Yoshi's down b as a landing option is in fact rather punishable. Jump over the landing "star" hitbox and start your favorite nair combo.
Last thing is recognizing Yoshi's weaknesses - range and recovery. Don't focus so much on your projectiles, Yoshi's airspeed and egg can invalidate your laggy-ass projectiles. As Link, your biggest asset against Yoshi is your big-ass sword. Against lower-skilled Yoshis, landing fullhop fair is a nightmare, especially in the corner. I usually space them out of fair while dodging the inevitable eggs and whiff punish with nair in neutral. Nair can also be used to beat out egg throw when approaching. Finally, Yoshi's recovery is good, but he's screwed without a jump. Either get him offstage without a jump, hit yoshi after the super armor frames of the jump, or use fair to beat out the super armor entirely.
Good luck my friend, Yoshi is annoying, but rest assured Link has the tools to deal with him.
Edited 1/31 for grammar mistakes and general readability