This is an old myth, but not really accurate. Like did she help and likely speed along the breakup? Sure. But they were having problems before Yoko came into the picture and she was largely the symptom of the disease (i.e. Lennon growing increasingly bored with being a Beatle and feeling constrained by it. Without Yoko they probably make it to 71, maybe 72 before Lennon or Harrison walk.
That aside it largely depends on what the circumstances are. Epstein not dying would certainly help. Giving Harrison more creative freedom and songs per album (or at least letting him release solo work while still being in the band.) would also solve some issues.
As far as I understand, there were 3 main problems that needed solving...
1 - Management. Find a manager that's going to make sure they get the royalties & income they deserve, someone with no favouritism towards any member, and that all of the Beatles can rightfully trust.
2 - Keep John engaged. after the end of touring, John was losing interest in the Beatles.. slowly at first.. but that accelerated with Magical Mystery Tour's failure, then falling in love with Yoko, then the whole Let It Be fiasco. Add heroin into the mix and he just didn't care anymore.. Paul was eager to fill the vacuum, but 1969 ended up virtually being a pilot episode for Paul's solo career.
Get John to call the shots on a Beatles project in late 1967 or early 1968, before his focus switches away.
3 - George needed more respect. George Harrison had an impressive stash of tunes in early 1969, but the old "1 or 2 tracks per disc" for him was a sore point. plus it meant that substandard Lennon/McCartney tunes made it on albums over gems from George. I mean, Maxwell's Silver Hammer vs All Things Must Pass? Come on...