Let the inf and sup of $A$ be $a_1,a_2$ and of $B$ be $b_1,b_2.$ Now let $R$ denote the rectangle $R=[a_1,a_2]\times [b_1,b_2],$ and we seek the sup of $p=xy$ over $R.$
We first assume that $A,B$ are the entire closed intervals between their respective inf and sup, and say later why this is OK. Note first that the only critical point of $p$ is at the origin. If this critical point happens to lie interior to $R$ then each of $a_2,b_2$ are positive, and since they are sups, there are sequences approaching them, so that the sup we seek is at least $a_2b_2>0,$ which means the sup of $p$ is positive, so the maximum of $p$ on $R$ does not occur at the critical point of $p$.
So the max of $p$ must occur at a boundary point of $R,$ and focusing on any of the four edges of $R$ then shows $p$ cannot have its max at an interior point of an edge of $R.$ This leaves only the four vertices of $R$ as candidates for the max of $p$ over $R.$ So by the usual method of maximizing a two variable differentiable function over a compact domain, the maximum of $p$ over $R$ is the greatest product among $a_1b_1,\ a_1b_2,\ a_2b_1,\ a_2b_2$ which in our notation is the desired supremum of $p.$ Call this amount $M.$
Slight correction: If an edge of $R$ happens to be along the $x$ or $y$ axis, then $p$is constant ($p=0$) on that edge. So above, instead of saying the max of $p$ cannot occur at an interior point of an edge, I should have said more correctly something like "The max of $p$ is taken on at an endpoint of the edge (and perhaps at interior points, if the edge is along an axis)."
Now of course the given sets $A,B$ need not be intervals, but by the above argument the product $p$ taken at any point $(x,y) \in A \times B$ will be at most $M$. We can be sure the supremum is actually equal to $M$ since whichever "corner" of the rectangle is chosen, there are sequences in $A,B$ approaching the coordinates of that corner.