You're on the right track. Your argument about "building an automorphism" shows that $\operatorname{Aut} G \times \operatorname{Aut} H$ is contained in $\operatorname{Aut} (G\times H)$.
Note that your argument does not make use of the assumption that $G$ and $H$ have relatively prime orders. Thus it shows that $\operatorname{Aut} G \times \operatorname{Aut} H$ is always contained in $\operatorname{Aut} (G\times H)$, regardless of the group orders.
What's missing is an argument that $\operatorname{Aut} (G\times H)$ doesn't have anything in it besides the things coming from $\operatorname{Aut} G\times\operatorname{Aut} H$. This is the part of the claim that depends on the assumption that $G$ and $H$ have relatively prime orders. Indeed, without this assumption, it's not true: for example if $G$ and $H$ are both cyclic of prime order $p$, then $\operatorname{Aut} (G\times H)$ is actually $GL(2,\mathbb{F}_p)$, which is significantly bigger than $\operatorname{Aut} G \times \operatorname{Aut} H = \mathbb{F}_p^\times \times\mathbb{F}_p^\times$. This is because there exist automorphisms that "mix up" $G$ and $H$. For example if $G=H=(\mathbb{F}_p,+)$, then there is an automorphism that fixes $(1,0)$ (so $G\times\{0\}$ stays inside $G\times\{0\}$), but sends $(0,1)$ to $(1,1)$ (so $\{0\}\times H$ is moved by the automorphism to somewhere else).
G. Sassatelli's hint is aimed at showing how you can rule out the possibility that $G\times H$ has any automorphisms that "mix up" the $G$ part (which is $G\times\{\text{identity in $H$}\}$) and the $H$ part (i.e. $\{\text{identity in $G$}\}\times H$). Use the fact that $G,H$ have prime orders.
(In case the phrase "characteristic subgroup" is new to you, it means a subgroup that is not moved to somewhere else by any automorphism.)