It seems to be well-known that a principal $\mathrm{SL}_n$-bundle on a scheme or manifold $X$ is the same as a vector bundle of rank $n$ whose determinant is a trivial line bundle. One direction is clear to me: A principal $\mathrm{SL}_n$-bundle corresponds to a principal $\mathrm{GL}_n$-bundle whose cocycles can be chosen to live in $\mathrm{SL}_n$, which means that we have a vector bundle of rank $n$ whose determinant has trivial cocycles. Conversely, if we are given a vector bundle of rank $n$ whose determinant is a trivial line bundle, this corresponds to a principal $\mathrm{GL}_n$-bundle whose determinant bundle has cocycles which are just coboundaries (not trivial). So how do we get cocycles in $\mathrm{SL}_n$?
Edit. Here is an attempt to spell out the details in MarianoSuárez-Alvarez's comment. Consider the short exact sequence of groups $1 \to \mathrm{SL}_n \to \mathrm{GL}_n \to \mathrm{GL}_1 \to 0$. It is split in the sense that $\mathrm{GL}_n \to \mathrm{GL}_1$ has a section, for example $\lambda \mapsto \mathrm{diag}(\lambda,1,\dotsc,1)$. We obtain an exact sequence of pointed sets $$0 \to H^1(X,\mathrm{SL}_n) \to H^1(X,\mathrm{GL}_n) \to H^1(X,\mathrm{GL}_1) \to 0$$ because $H^i(X,\mathrm{GL}_n) \to H^i(X,\mathrm{GL}_1)$ is surjective for $i=0,1$. But this means that $0 \to \mathrm{Bun}_{\mathrm{SL}_n}(X) \to \mathrm{Vect}_n(X) \to \mathrm{Pic}(X) \to 0$ is exact, proving the claim. Essentially the same argument is given in archipelago's answer without using the language of cohomology.
If $$GL_n\rightarrow E\stackrel{\pi}{\rightarrow} B$$ is a principal $GL_n$-bundle with a trivializing open cover ${U_i}$, trivializations $$\psi_i\colon U_i\times GL_n\rightarrow \pi^{-1}(U_i)$$ and induced cocylces $$\psi_{ij}\colon U_i\cap U_j\rightarrow GL_n,$$ the determinant of this bundle is the principal $GL_1$ bundle given by the coclyes $$det(\psi_{ij})\colon U_i\cap U_j\rightarrow GL_n,p\mapsto det(\psi_{i,j}(p)).$$
So suppose the determinant bundle is trivial, then the cocyles $det(\psi_{ij})$ are just coboundaries, i.e. we have maps $\eta_i\colon U_i\rightarrow GL_1$, such that $$det(\psi_{ij})(p)=\eta_i(p)^{-1}\eta_j(p).$$ Now one can define new trivializations $\psi_i'$ of the original bundle by using $\psi_i$ and $\eta_i$, such that the induced cocyles have determinant one.
If I guess correctly $\psi_i'(p,A)=\psi_i(p,A\eta_i(p)^{-1/n})$ does the job since it should induce cocylces given by $\psi' _{ij}(p)=\psi_{ij}(p)\eta_j(p)^{-1/n}\eta_i(p)^{1/n}$, which have determinant one.