Problem taken from dummit and Foote section $1.5$
Find a set of generators and relations for $Q_8$.
My attempt : The quaternion group $Q_8$ is defined by $ Q_8=\{1,-1,i,-i,j,-j,k,-k\} $
Therefore the set of generator are $1,i,j$ and $k$
But here i don't know how to find the relation for $Q_8$
You can use $1,i,j,k$ to generate $Q_8$, but there are redundancies here. For instance, I think you know that $i^4=1$, so we don't need $1$ in the generating set (in fact, we never need to include the identity in a generating set). Similarly, we have $ij=k$, so we don't need $k$. Indeed, $\{i,j\}$ is a minimal generating set of $Q_8$.
As for relations, well, I gave you two above: $i^4=1$ and $ij=k$. Are these all the relations? Certainly not, since we can't deduce from these what $i^2$, or $-1\cdot j$ are.
A complete multiplication table would be a sufficient list of relations. However, like your generating set, it can be greatly reduced. In this case, the classic list of defining relations of $Q_8$ are $$ (-1)^2=1\\ (-1)i=i(-1)=-i\\ (-1)j=j(-1)=-j\\ (-1)k=k(-1)=-k\\ i^2=-1\\ j^2=-1\\ k^2=-1\\ ij=k $$ From these 11 multiplication table entries (as well as the 15 entries given by stating "$1$ is the identity element"), all 64 possible products may be deduced. Often, though, the first four lines here will be considered implicit (what else would $-1$ mean?), and the last one will be multiplied by $k$ on both sides to yield $ijk=-1$. This way we can write $$ i^2=j^2=k^2=ijk=-1 $$ and say that this defines $Q_8$.