With use of the chains and positioning library, and defining nodes style as options of `tikzpicture:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,
positioning}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
node distance = 0pt,
start chain = going below,
C/.style = {circle, draw=blue!50,thick, fill=blue!20,
inner sep=0pt, minimum size=3cm,
on chain},
R/.style = {draw=black!50, thick, fill=black!20,
inner sep=0pt, minimum size=3cm,
on chain}
]
\node[R] (n1) {};
\node[C] (n2) {};
\node[R] (n3) {};
\end{tikzpicture}
\caption{Caption}
\label{fig:my_label}
\end{figure}
\end{document}
Result of compilation is:

Addendum:
Regarding your comment with your new request:
- Please don't add some code to my answer which change it. If you have new problem, please ask new question, if you like to clarify your problem, edit your question and describe it there, that it can be seen to other members of site.
- Arrows with labels between rectangles in your images you can draw as edges with quotes. See MWE below.
- In MWE below is changed nodes style declaration too. I do this to show one more possibilities how to define it and that they support your new request in comment.
- Style and text of quotes you can change according to your needs.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
chains,
positioning,
quotes}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[
node distance = 0pt,
start chain = going below,
base/.style = {draw=#1!50, thick, fill=#1!20,
inner sep=0pt, outer sep=0pt, minimum size=3cm,
on chain}, % <--- new
C/.style = {circle, base=blue}, % <--- changed
R/.style = {base=black}, % <--- changed
every edge/.style = {draw, -Straight Barb, semithick, bend angle=45}, % <--- for edges
every edge quotes/.style = {auto=right, font=\small\bfseries} % <--- for quotes on edges
]
\node[R] (n1) {};
\node[C] (n2) {};
\node[R] (n3) {};
% edges
\draw (n1.west) edge [bend right, "A"] (n3.west)
(n3.east) edge [bend right, "B"] (n1.east);
\end{tikzpicture}
\caption{Caption}
\label{fig:my_label}
\end{figure}
\end{document}

\documentclass{...}and ending with\end{document}. And while you're at it, feel free to add a sketch of the desired result, since your question is not clear enough, to me at least. – SebGlav Jan 31 '22 at 22:04