Break play into episodes you can finish in one play session. Each episode should be self-contained and easily completed in one afternoon or evening. Set up an episode to be fairly independent of the amount of time elapsed since the last, and independent of the characters. Imagine your campaign like a tv series. Yes, the stuff that happened before an episode matters, but which characters are present and what they're doing seems to be disconnected from previous episodes.
Build play around a central in-game location. If the PCs have a base of operations, then you can assume (and require) that they return to the base between episodes. That is, they aren't allowed to get stuck in a dungeon and just put their characters on hold until they can play again. Or allow it, but say that those characters are stuck together until the entire group gets back to the base. If one or two players can show up to finish that episode, then they have to bring new characters.
Play games that aren't built around the "party." D&D is a game where the PCs have to work as a group. There are games where this isn't the assumption. For example, Annalise is a horror game where characters may interact freely or have scenes all by themselves. It'd work great for a game where players come and go from session to session.
Relax your assumptions about "the group." Barriers to bringing PCs in and out of "the group" often stem from very rigid assumptions about why the group is together. Even in games like D&D, with a little effort, you can change the core assumption about the party. Base your adventures in a city and make the PCs a loosely-aligned group of like-minded people. Give the characters other responsibilities so that it's easy to explain why the cleric isn't around right now ("he's got vital business at the temple").