See the cleveref package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.134 \begin{document}
                      
Package load order is wrong: load cleveref *after* amsmath.
{Real-Time Explainability** \index {Explainable AI!Real-Time Explaina\ETC.
! File ended while scanning use of \@xdblarg.
<inserted text> 
                \par 
l.159 \include{chapters/chapter1/chapter1}
                                          
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

{\contentsline {subsection}{\numberline {2.1.7}Conclusion}{20}{subsec\ETC.
! File ended while scanning use of \@writefile.
<inserted text> 
                \par 
l.17 \@input{chapters/chapter2/chapter2.aux}
                                            
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

\documentclass[12pt, a4paper, openright, oneside]{book}

% ----------------------------
% Encoding and Language
% ----------------------------
\usepackage[utf8]{inputenc}       % UTF-8 encoding
\usepackage[T1]{fontenc}          % Output font encoding
\usepackage[english]{babel}       % Language

% ----------------------------
% Page Layout and Styling
% ----------------------------
\usepackage{geometry}             % Page dimensions
\geometry{
    left=3cm,
    right=3cm,
    top=3cm,
    bottom=3cm,
}

\usepackage{fancyhdr}             % Custom headers and footers
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\renewcommand{\headrulewidth}{0.5pt}

\usepackage{titlesec}             % Custom section titles
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptername\ \thechapter}{20pt}{\Huge}

% ----------------------------
% Fonts and Typography
% ----------------------------
\usepackage{mathpazo}             % Palatino font
\usepackage{microtype}            % Improved typography

% ----------------------------
% Graphics and Figures
% ----------------------------
\usepackage{graphicx}             % Include images
\usepackage{float}                % Floating objects
\usepackage{caption}              % Custom captions
\usepackage{subcaption}           % Subfigures

% ----------------------------
% Tables
% ----------------------------
\usepackage{booktabs}             % Professional tables
\usepackage{longtable}            % Tables across pages
\usepackage{tabularx}             % Tables with adjustable width

% ----------------------------
% Lists and Enumerations
% ----------------------------
\usepackage{enumitem}             % Custom lists

% ----------------------------
% Hyperlinks and References
% ----------------------------
\usepackage{hyperref}             % Hyperlinks
\usepackage{cleveref}             % Enhanced cross-referencing

\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    citecolor=blue,
    urlcolor=blue,
    pdftitle={Explainable AI (XAI) Book},
    pdfauthor={Your Name},
}

% ----------------------------
% Bibliography
% ----------------------------
\usepackage[backend=biber, style=apa, natbib=true]{biblatex}
\addbibresource{bibliography/references.bib}


% YourBookProject/
% ├── main.tex
% ├── chapters/
% │   ├── chapter1/
% │   │   └── chapter1.tex
% │   ├── chapter2/
% │   │   └── chapter2.tex
% │   └── ... (additional chapters)
% ├── images/
% │   └── ... (all image files)
% ├── bibliography/
% │   └── references.bib
% ├── styles/
% │   └── custom.sty
% └── glossary/
%     └── glossary.tex

% ----------------------------
% Index
% ----------------------------
\usepackage{makeidx}
\makeindex

% ----------------------------
% Glossary
% ----------------------------
\usepackage[toc, acronym]{glossaries}
\makeglossaries
% \input{glossary/glossary.tex}

% ----------------------------
% Additional Packages
% ----------------------------
\usepackage{amsmath, amssymb, amsthm} % Math packages
\usepackage{tikz}                      % Drawing
\usepackage{algorithm}
\usepackage{algpseudocode}

% ----------------------------
% Custom Commands and Environments
% ----------------------------
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

% ----------------------------
% Document Information
% ----------------------------
\title{Explainable AI (XAI)}
\author{Your Name}
\date{\today}

% ----------------------------
% Begin Document
% ----------------------------
\begin{document}

% ----------------------------
% Front Matter
% ----------------------------
\frontmatter

\maketitle

% \begin{abstract}
%     Your abstract goes here. Provide a concise summary of the book's content, objectives, and significance in the field of Explainable AI.
% \end{abstract}

\tableofcontents
\listoffigures
\listoftables
\printglossaries
\printindex

% ----------------------------
% Main Matter
% ----------------------------
\mainmatter

% Include Chapters from Separate Folders
\include{chapters/chapter1/chapter1}
\include{chapters/chapter2/chapter2}
\include{chapters/chapter3/chapter3}
% ... add additional chapters as needed

% ----------------------------
% Back Matter
% ----------------------------
\backmatter

% \chapter{Bibliography}
% \nocite{*}
% \printbibliography

\end{document}