For the classic era 1, 2, and 4 tell the core story and 3 is cool but not too important.
1 has a great version on SEGA AGES. Light on story and character development, but it's a fun romp that doesn't take too long and Alis, the main heroine, is referenced, cameos, and otherwise appears/alluded to in either major or subtle ways in almost every single game going forward.
2 is technically the most "iconic" by far, as it's where most of Phantasy Star got its longterm trappings for things like how the setting feels, characters are designed, the music, iconic moments, and things like that but it's also unfortunately the hardest to actually play because it's mostly dungeons. Details about each individual character's backstories and personalities are greatly expanded by the text adventures, which got an English fan translation not long ago.
3 is cool, especially its generation system that probably helped inspire Fire Emblem's, but it's also painfully unfinished and you can tell. Go for it if you want more after playing the others, but it's very rough around the edges.
4 is the easiest to play, has the best characters, story, and is just a great classic RPG. If you love 16 bit RPGs and haven't played PSIV, you should. Like, you definitely should. It's top 10, if not top 5. With the ending of PSIV, Classic Era's story was considered "finished."
All are available on Switch in some way. AGES for 1 and I think some kinda MegaDrive/Genesis collection for the rest. PSIV is also on the Mega Drive/Genesis Mini if you have it already. The MD/GEN collection on Steam also has "mods," which includes mods for PSII that let you play through fan-translations of the text adventures, which are pretty important to learning much of anything about anyone besides Rolf and Nei.
---------------------
The original Online was massively beloved and can still be played on private servers, but depending on how they're set up they may not be the best for Story content. It's the only way to play the fourth episode though, so that's a shame. If you can't find a good one (or just don't want to), go for the Gamecube version of PSO Episodes 1+2 and then 3 if you're feeling really invested as it wraps eeeeverything up (and actually takes place after Blue Burst's Ep. 4) but is also a completely different genre because they made it a card game for some reason????
Zero on DS is a prequel to Online, but it's a little obtuse in how it fits if you don't already know that.
Universe-era on PS2 and PSP is skippable because most of it's in Japanese only afaik. Worth a go if you're curious, but it might be a pain and is its own contained... universe, story-wise.
PSO2, in spite of being "Online 2," is also its own contained universe that takes lots of bits from different incarnations of PS and runs with them. Though it does also call back to the original Online in a LOT of ways you may only pick up if you played it. You can basically just download it and play now since it's F2P and has 8 years worth of content.
PSO2 New Genesis is a direct continuation of classic PSO2 and runs from the same client/lets you use the same character, but it's... very early and has basically nothing to do. Will probably get really going in a year or two, like PSO2 did.
(edited in a few small additional details)