Biden should have simply refused to run again in 2024. There was already signalling to this effect in 2019, though it was never explicitly promised.[1][2] If he had just kept to that, there would have been plenty of time to run a primary and an actually strong candidate could have been selected.
1: https://slate.com/news-and-politics/2019/12/joe-biden-one-te...
2: https://slate.com/news-and-politics/2024/06/biden-president-...