In John Preskill's notes on measurement (pg 16), he makes the following step.

Let $| \mu\rangle $ and $ | \nu \rangle $ be basis vectors of the Hilbert space $B$, wherein $|0\rangle $ lies.

Let $| i\rangle$ and $ | j \rangle $ be basis vectors of the Hilbert space $A.$

$$\textrm{tr}_B (U_{AB} ( \rho_A \otimes |0\rangle \langle 0| ) U_{AB}^+ )$$ $$= \sum_{ \mu} \langle \mu | U_{AB} |0\rangle \rho_A \langle 0|U_{AB}^+ | \mu \rangle $$

...where $\langle \mu | U_{AB} | 0 \rangle $ is a matrix whose elements are

$$(\langle i| \otimes \langle \mu |) U_{AB} (| 0 \langle \otimes | j \rangle)$$

I'm new to partial traces and operators acting on product states, so I've been reading about it, but I can't figure this one out. There is no explanation why this should be the case in the notes. Is there a property of the partial trace which makes it easy to compute something of the form $\textrm{tr}_B(U (\rho_A \otimes \rho_B ) U^+)$ ?

I have heard that it helps to expand in a basis, but I do not know how to do that in this sort of space. I think if I could put the expression inside the trace in terms of some linear combination $$\sum_{i,j} c_{i,j} |i\rangle \langle i| \otimes|\mu\rangle \langle \mu|$$ then I could figure it out from there. Advice on this would be greatly appreciated.