My professor used the following presentation for $D_8:$
$$D_8 = \{s,t | s^2 = t^2 = (st)^4 = 1\}$$
But I am not sure if this presentation is correct, I looked at subWiki here https://groupprops.subwiki.org/wiki/Constructing_dihedral_group:D8_from_its_presentation but I also could not find this presentation. Can someone tell me if this is really another equivalent presentation for $D_8$ or my professor made a mistake? and how to check that 2 presentations are equivalent.
Like Arturo Magidin already said in the comments of your question: You can solve this equality by showing both presentations are equal regarding tietze transformations.
The two needed here are adding a generator with a relation and then removing a generator under certain conditions.
Let us first add a generator with a relation for it: $$ \begin{align} &\langle s,t \mid s^2, t^2, (st)^4 \rangle \\ = &\langle s,t,u \mid s^2, t^2, (st)^4, u=st \rangle \end{align} $$ (Note: I usually omit the $=1$ part when every relator is $=1$.)
Now we can replace all instances of for example $t$ with the new relator:
$$ \begin{align} &\langle s,t,u \mid s^2, t^2, (st)^4, u=st \rangle \\ = & \langle s,t,u \mid s^2, (sst)^2, (st)^4, u=st \rangle \\ = & \langle s,t,u \mid s^2, (su)^2, (u)^4, u=st \rangle \end{align} $$ Now because $t$ is in exactly one relation and the relations do not include $t^{-1}$ we can remove it and the relation:
$$ \begin{align} & \langle s,t,u \mid s^2, (su)^2, (u)^4, u=st \rangle \\ = & \langle s,u \mid s^2, (su)^2, (u)^4 \rangle \end{align} $$
Now we can see that both presentations are equal and the groups they generate are at least isomorphic.
I wanted to give you a good resource to read up on tietze transformations, as I learned it at university with a script I think is not public and the online resources I found did not look that great. If anybody has a recommendation I would be happy.