I'll be referencing and using the first diagram from this wiki page. I want to convince myself that the $\operatorname{Hom}(\_,Y)$ functor preserves coproducts. So, I'll start by applying $\operatorname{Hom}(\_,Y)$ to the objects of the diagram. We get maps $\operatorname{Hom}(X_1,Y)$, $\operatorname{Hom}(X_2,Y)$ and $\operatorname{Hom}(X_1\amalg X_2,Y)$. The category sets is cartesian closed hence we can take $\operatorname{Hom}(X_1,Y)\times \operatorname{Hom}(X_2,Y)$ to be an element of the category we land in. Finally, by the universal mapping property (UMP) of the coproduct we have that $$ \operatorname{Hom}(X_1,Y)\times\operatorname{Hom}(X_2,Y) \cong\operatorname{Hom}(X_1\amalg X_2,Y) $$
I'm a little worried by my use of the UMP. I know the isomorphism $\operatorname{Hom}(X_1,Y)\times\operatorname{Hom}(X_2,Y) \cong\operatorname{Hom}(X_1\amalg X_2,Y)$ is true and that I'm supposed to use the UMP somehow (basically it's the only property at my disposal) but I was hoping someone could elaborate for me. Should I be trying to use that fact that the contravariant $\operatorname{Hom}$ functor takes morphisms, say $f:X\to Y$, to precomposition with $Hom(X,Y)$?