Ness's aerials are very potent as well as his throws, d-throw is an early combo starter usually resulting in a string of fairs if you DI away from him or an uair if you DI above him, b-throw is arguably one of the best kill throws in the game as well, meaning you avoid getting grabbed at all costs.
Your air game isn't as good as Ness, however Link's ground game has an advantage over Ness due to his long disjointed sword.
>Jab to keep him from closing in for a grab (Jab1-2)
>U-tilt, pivot F-tilt, d-smash, Spin Attack (if you're feeling lucky) to catch his rolls
>U-tilt, U-Smash if you find him floating above you too often
If you find yourself caught in the air
>Pull out a bomb, although Ness can absorb it, he most likely won't attempt to do so thanks to PK Magnet's endlag if used in the air
>Throw out a zair if he's closing in on you horizontally and isn't in his fair range yet
>FF Nair or Fair which could trade with Ness's fair, you could possibly Dair (risky) as well due to the enlarged hitbox, which might out-prioritize Ness's uair and fair
Ness will also try to use PK Fire as a combo starter, but due to it's endlag and startup you could crouch block with the Hylian Shield and go in for a dashgrab or dash attack, considering Link can jump over the PK Fire bolt
You're projectiles on the ground also have more range than Ness's, so use them to space him out
>Arrows travel faster than his PK Thunder, and cannot be absorbed.
>Gale Boomerang travels further than his PK Fire and acts as a wall to cancel out his PK Thunder, cannot be absorbed either
>Bombs cancel out his PK Thunder entirely and if soft thrown or z-dropped, might be able to cancel PK Fire as well
Offstage:
>Always pull out a bomb, either you can use it as a deterrent or use it to bomb jump
>Boomerang can create a wall to prevent you from getting PK Thundered to death
If you manage to take away Ness's double jump, it's game, his PK Thunder recovery is pretty susceptible to being gimped
>Nair cancels out his PK Thunder
>Gale Guarding can half his recovery distance or completely cancel out the PK Thunder
>Dair can cancel out the PK Thunder, but trading with Ness during his launch is probably a terrible idea
Overall, as long as you can zone him out and not get grabbed or launched in the air, you should be fine.