Suppose $X_1,\ldots,X_n,Y_1,\ldots,Y_n$ are i.i.d $\mathcal N(0,1)$ random variables.
I am interested in the distribution of $$U=\frac{\sum_{i=1}^n X_iY_i}{\sum_{i=1}^n X_i^2}$$
I define $$Z=\frac{\sum_{i=1}^n X_iY_i}{\sqrt{\sum_{i=1}^n X_i^2}}$$
Then, $$Z\mid (X_1=x_1,\ldots,X_n=x_n)=\frac{\sum_{i=1}^n x_iY_i}{\sqrt{\sum_{i=1}^n x_i^2}}\sim \mathcal N(0,1)$$
As this conditional distribution is independent of $X_1,\ldots,X_n$, the unconditional distribution should also be the same. That is, I can say that $$Z\sim \mathcal N(0,1)$$
Relating $U$ and $Z$, I have $$U=\frac{Z}{\sqrt{\sum_{i=1}^n X_i^2}}$$
Now since I saw that $Z\mid (X_1,\ldots,X_n)\stackrel{d}{=}Z$, I can say that $Z$ is independent of $X_1,\ldots,X_n$.
So I have
$$U=\frac{1}{\sqrt n}\frac{Z}{\sqrt{\frac{\sum_{i=1}^n X_i^2}{n}}}=\frac{T}{\sqrt n}$$, where $T$ is distributed as a $t$ distribution with $n$ degrees of freedom.
I think conditioning is the easiest way to see the result here. But is this a perfectly rigorous argument and is there any direct/alternative way of finding distributions of such functions of linear combinations of i.i.d Normal variables?