Dealing with projectiles is a competitive entry barrier in smash. It's an essential skill to succeed.
The most important thing is to respect what your opponent is doing. If you get flustered thinking, "Ugh this spammer is friggin doing the same thing over and over and over!" you're going to make rash decisions and take chip damage that you didn't need to take. Just relax.
Now, how do you actually deal with it?
You walk.
That's right. Walk.
Not run. Not dash. Not jump. Walk.
The reason I'm telling you to walk is that walking leaves all your options open to you. While you're running or jumping or dashing, you can only do so many things--you can't perform tilts, or smashes, or spotdodges, or whatever. But while you're walking you can pause anywhere, any time, and do anything, and that's intimidating for your opponent.
As you walk, powershield the projectiles on reaction and gain ground. When you get close to your opponent, you have to start being aware of rolls, grabs, and jabs that will try to get you away again. If your opponent continues to fire projectiles at close range, you have an easy punish, but otherwise, just stay calm and try to learn your opponent's panic patterns. But at this point, at least the projectile part is done. It gets neutralized by your walking spacing.