After reading this post from Milewski's blog, I think the definition of product is defined as follows
Given A and B are objects in a Category. $X$ is a product of A and B if and only if there is a pair of morphisms:
$$\pi_1 :: X \rightarrow A, \quad\pi_2 :: X \rightarrow B$$ and for any "other" object $Y$ with a pair of morphisms $$q_1 :: Y \rightarrow A, \quad p_2 :: Y \rightarrow B$$
There is a unique morphism $h$, such that $q_1 = \pi_1 \circ h$ and $q_2 = \pi_2 \circ h$
I highlight "other" in the definition as I also see this in other places 2. If we have "other" in the definition can we still prove that all the products of $A$ and $B$ satisfying the definition are isomorphic to each other?
My attempt to prove it is to show that if $X$ and $X'$ both satisfying the definition of the product $A \times B$, then we know there is a morphism $h: X \rightarrow X'$ and a morphism $h': X' \rightarrow X$. I want to show that $h' \circ h = id_X$ by choosing $Y=X$ and show that $id_{X}$ is the unique morphism from $X$ to $X$, but it seems that the "other" requirement in the definition prevents me from doing that.
As discussed in the comments, the term "other" here is not intended to require $Y$ to be distinct from $X$. So, there is no difficulty carrying out your argument. This usage of "other" is fairly common in mathematics, though I would personally consider it ambiguous enough to recommend avoiding it in formal mathematical writing.
If you interpret the definition to require that $Y\neq X$ in order to use the universal property, then a product need not be unique up to isomorphism. For example, consider the following subcategory of the category of sets. The objects are $A=\{0\},B=\{1\},X=\{2,3\},$ and $X'=\{4,5\}$. The morphisms are the identity functions, the unique functions from each of $X$ and $X'$ to $A$ and $B$, the constant functions $X\to X$ and $X'\to X$ with constant value $2$, and the constant function $X'\to X'$ and $X\to X$ with constant value $4$. It is then straightforward to verify that both $X$ and $X'$ are "products" of $A$ and $B$ in this category if you require $Y\neq X$ in the universal property, but are not isomorphic. For instance, to check that $X$ is a "product" of $A$ and $B$, the only choice of $Y$ you have to consider is $X'$, and the unique map $X\to X'$ (the constant $4$ map) has the required properties.