Context : I am currently self-studying homological algebra and would like to garner greater intuition about injective modules/resolutions; in particular about how injective co-generators "work". I will focus on the case of $\mathbb{Z}$-modules as for other $R$-modules I can know I can obtain injectives by extension of scalars.
Onto the actual question, from literature I know that $\mathbb{Q} / \mathbb{Z}$ is an injective co-generator for the category of $\mathbb{Z}$-modules which means that in principle every $\mathbb{Z}$-module should be contained as a submodule of some product of modules $\mathbb{Q} / \mathbb{Z}$, however I am having trouble picturing what the precise embedding of some arbitrary $\mathbb{Z}$-module $M$ into $\prod \mathbb{Q} / \mathbb{Z}$ ought to be.
So far I have garnered the following "ideas", which I hope are valid but I am still uncertain. Firstly, since a homomorphism is determined by it's generators it suffices that I embed these correctly, thus I figure that for $\mathbb{Z}$-modules of the form $\mathbb{Z}/n\mathbb{Z}$ I can just define a homomorphism $f : \mathbb{Z}/n\mathbb{Z} \to \mathbb{Q} / \mathbb{Z}$ given by $f(1) = \frac{1}{n} + \mathbb{Z}$. This also takes care of the case of modules which are products of $\mathbb{Z}/n\mathbb{Z}$ as the map could be given "component-wise". However, this is where I run out of ideas.
For instance I have no idea how modules such as $\mathbb{Z}$ or $\mathbb{Q}$ ought to be submodules of some product of $\mathbb{Q} / \mathbb{Z}$. I know that clearly this product would have to be infinite as any element $x$ where $x \in \prod_{n=0}^{k} \mathbb{Q} / \mathbb{Z}$ for some finite product would clearly have finite order, however I am not sure what the correct embedding of modules such as $\mathbb{Z}$ or $\mathbb{Q}$ for an infinite product of $\mathbb{Q} / \mathbb{Z}$ ought to be.
Hence, in summary my question is what are the correct homomorphisms which embed $\mathbb{Z}$ and $\mathbb{Q}$ into $\prod \mathbb{Q} / \mathbb{Z}$? (preferably with the homomorphism from $\mathbb{Z}$ being provided by a concrete description of where the generator $1$ is sent).
Also, as a follow-up question, what is the correct strategy in general for finding the embeddings of $\mathbb{Z}$-modules into $\prod \mathbb{Q} / \mathbb{Z}$?
Let $A$ be an abelian group and let $S$ be the set of all homomorphisms $A\to\mathbb{Q}/\mathbb{Z}$. Then you can embed $A$ in a product of copies of $\mathbb{Q}/\mathbb{Z}$ by simply taking the map $i:A\to(\mathbb{Q}/\mathbb{Z})^S$ such that for each $a\in A$ and $f\in S$, the $f$-coordinate of $i(a)$ is $f(a)$. In other words, you take a map to a product of copies of $\mathbb{Q}/\mathbb{Z}$ whose coordinates are all possible homomorphisms $A\to\mathbb{Q}/\mathbb{Z}$.
To prove that $i$ is an embedding, let $a\in A$ be nonzero; we wish to show $i(a)$ is nonzero. This just means we need some $f\in S$ such that $f(a)\neq 0$. Let $B$ be the subgroup of $A$ generated by $a$, and let us first construct a homomorphism $f_0:B\to\mathbb{Q}/\mathbb{Z}$ such that $f_0(a)\neq 0$. If $B$ has finite order, then $B\cong\mathbb{Z}/n\mathbb{Z}$ so as you have mentioned we can take $f_0$ to be an embedding of $B$ into $\mathbb{Q}/\mathbb{Z}$. Otherwise, $B$ is freely generated by $a$ so we can take $f_0$ to send $a$ to whatever nonzero element of $\mathbb{Q}/\mathbb{Z}$ we want. So, either way, we have $f_0:B\to\mathbb{Q}/\mathbb{Z}$ such that $f_0(a)\neq 0$. Now, since $\mathbb{Q}/\mathbb{Z}$ is injective, we can extend $f_0$ to a homomorphism $f:A\to\mathbb{Q}/\mathbb{Z}$ defined on all of $A$, and this $f$ will still satisfy $f(a)\neq 0$. (Note that the existence of this extension requires the axiom of choice in general and so you should not expect an explicit description; basically, you extend it to larger and larger subgroups of $A$ by transfinite recursion, using the fact that $\mathbb{Q}/\mathbb{Z}$ is divisible to find an extension each time you add one new generator.)
In specific examples, you can sometimes get an embedding that is smaller and more concrete than this "universal" embedding that uses all possible homomorphisms. For instance, in the case $A=\mathbb{Q}$, you can observe that for any $q\in\mathbb{Q}$ there is a homomorphism $f_q:\mathbb{Q}\to\mathbb{Q}/\mathbb{Z}$ given by $f_q(a)=aq+\mathbb{Z}$. For fixed $a$, you can always find a $q$ such that this is nonzero, since you just need $aq$ to not be an integer (so for instance you could take $q=1/n$ where $n$ is not a divisor of the numerator of $a$). So, you can embed $\mathbb{Q}$ in a product of copies of $\mathbb{Q}/\mathbb{Z}$ by taking the coordinates to be these maps $f_q$ for each $q\in\mathbb{Q}$ (or even just for $q$ of the form $1/2^n$, say, since for any nonzero $a$ there is always such a $q$ such that $aq$ is not an integer).