Here is my code:
\chapter{What Is Artificial Intelligence?}
\href{https://en.wikipedia.org/wiki/Artificial_intelligence}{Artificial intelligence} has become a very essential aspect of our life, from self-driving cars to robots that perform daily activities for us. Artificial intelligence, or AI, is an area of \href{https://en.wikipedia.org/wiki/Computer_science}{computer science} that deals with people being able to build intelligent computers capable of performing tasks that would normally need human intelligence. Companies such as Apple, Ford, and Tesla are moving toward a more AI-based approach to problem-solving, as well as attempting to integrate robots into their factories that could potentially replace humans in the next 30 to 40 years. Although, in a nutshell, this may appear to be a broad subject, you may wonder how humans are able to create AI models.
\begin{figure}
\includegraphics[width=\linewidth]{Alan_Turing_Bilal_Rashid/bbbb.jpg}
\caption{A boat.}
\label{fig:boat1}
\end{figure}
\begin{center}
\textbf{Machine Learning}
\href{https://en.wikipedia.org/wiki/Machine_learning}{Machine learning} is a branch of artificial intelligence and computer science, which uses datasets and mathematical algorithms to make decisions and identify patterns using very little human intervention. Below are three very common machine learning algorithms that help train a machine learning model.
\end{center}
I don't know why the picture is coming after the "Machine Learning" block, can anyone help me solve this?
Here is a pic for reference: 
begin{figure}the purpose offigureis to mark it as a float that is taken out of the main document flow and may be re-inserted elsewhere depending on page breaking. use\begin{figure}[htbp]to tell latex it may usehto leave it in the same place if possible – David Carlisle Dec 11 '21 at 21:31