You should at least try to solve this yourself and ask for more specific help.
Start by looking at tools like this: https://pypi.org/project/PyPDF2/
or this: https://github.com/pymupdf/PyMuPDF
A high-level approach to this solution could be extracting metadata and segmenting the document based on visual cues like title, blank pages, headers, and footers. Then tag the pages based on this. Then sort and extract into separate files.
This can be a deep and rewarding journey for you. good luck.