Typical steps
Uninstall Calibre 5. It will leave all your library and settings alone.
Download the Calibre 4.23 from
https://download.calibre-ebook.com/4.23.0/
And install.
Job done.
For Linux Users
If you are using Linux then go to
https://calibre-ebook.com/download_linux and read the section "Reverting to a previous version". This will show you how to do all the work for you