I want a particular value of $Y$, let's say $Y_k$. Which value of $X$ will maximize the chances of getting $Y_k$?
My guess is that if I consider the values of $P(Y_k|i)$ where $i$ takes all possible values of $X$, then whichever such $i$ gives the highest value of this, is my choice of $X$ to maximise my chances of getting $Y_k$.
If this is correct, then I would like to know how to prove that this is the best possible value of $X$.
I preassume that $X$ and $Y$ are discrete.
Let $S:=\{x\mid P(X=x)>0\}$.
Then $S$ is a countable set with $P(X\in S)=1$.
If we observe that $p_i:=P(Y=y_k\mid X=i)$ is the largest element of the set $\{P(Y=y_k\mid X=j):j\in S\}$ then we can state that in words by saying that "under condition $X=i$ the probability of $Y$ taking value $y_k$ is maximal".
No objection if your reformulate that a bit, but a proof is not really needed: it speaks for itself.
If $X$ and $Y$ are not discrete but have a common PDF $f$ then I would go searching for the value $x$ that "maximizes" integral $\int f(x,y)dy$