I just recently completed a problem in which I had a Hilbert space of the form
$$ H = H_1 \otimes H_2 \otimes H_3 $$ and was tasked with finding the reduced density matrix for the system in the subspace $$ H^\prime = H_1 \otimes H_2 $$ for some explicit states on an orthonormal basis. For our purposes, we can assume the orthonormal basis to be that of a qubit. I was able to determine that, for a state $|\psi\rangle$, the reduced density matrix follows from computing $$ \hat{\rho}_{\psi^\prime} = \mathrm{Tr}_3(\hat{\rho}_\psi).$$ For example, if we have $$ |\psi\rangle = |0\rangle_1\otimes |0\rangle_2 \otimes |0\rangle_3,$$ our density matrix is $$ \hat{\rho}_\psi = |0\rangle_1\otimes |0\rangle_2 \otimes |0\rangle_3 \otimes \langle 0|_1 \otimes \langle 0|_2 \otimes \langle 0|_3 $$ such that, when we compute the trace in the $H_3$ basis with $$ \mathrm{Tr}_3(\hat{\rho}_\psi) = \langle 0|_3 \hat{\rho}_\psi|0\rangle_3 + \langle 1|_3 \hat{\rho}_\psi|1\rangle_3, $$ we get $$ \hat{\rho}_{\psi^\prime} = |0\rangle_1 \otimes |0\rangle_2 \otimes \langle 0|_1 \otimes \langle 0|_2. $$
I am quite comfortable with this and wrote things explicitly using tensor products to keep everything nice and tidy. From here, I know how to compute $\mathrm{Tr}_1(\hat{\rho}_\psi)$ and $\mathrm{Tr}_2(\hat{\rho}_\psi)$.
Moreover, I can extrapolate the above procedure to an $n-$dimensional Hilbert space whereby I can compute the reduced density matrix for every $(n-1)-$dimensional subspace. All I need to do is compute the trace in the $H_i$ basis for whatever value of $i$ I choose. However, here is where I am puzzling over how to generalize my procedure.
Suppose we now have $$H^{\prime \prime} = H_2.$$
Would we compute the reduced density matrix for a system in this subspace via
$$\hat{\rho}_{\psi^{\prime \prime}} = \mathrm{Tr}_1(\mathrm{Tr}_3(\hat{\rho}_\psi)) = \mathrm{Tr}_3(\mathrm{Tr}_1(\hat{\rho}_\psi))?$$
Generalizing further, suppose our initial Hilbert space is now $$ H = H_1 \otimes H_2 \dots \otimes H_n $$ for a finite natural number $n$ and we'd like to find the reduced density matrix for a finite subspace $$ H^\prime = H_i \otimes H_{j}\otimes \dots \otimes H_k $$ where $i,j,k$, and all numbers in between constitute a finite subset of the set $\{1,\dots,n\}.$ Would it be correct to infer from my above considerations that $$ \hat{\rho}_{\psi^\prime} = \mathrm{Tr}_i(\mathrm{Tr}_j\dots(\mathrm{Tr}_k(\hat{\rho}_\psi))) = \mathrm{Tr}_{i,j,\dots,k}(\hat{\rho}_\psi)? $$ Thanks in advance!