As user1104 commented, you use Euler's identity:
$$ e^{ix} = \cos(x) + i \space \sin(x) $$
so:
$$ \sin(kx-\omega t) = \frac{ e^{i(kx-\omega t)} - e^{-i(kx-\omega t)}}{2i} $$
But we wouldn't normally proceed by replacing sin by this expression. Both the sin form and the exponential form are mathematically valid solutions to the wave equation, so the only question is their physical validity. In QM we don't worry about having a complex solution because the observable is the squared modulus, which is always real.
For a guitar string obviously the complex form isn't physically valid, but any sum of solutions to the wave equation is also a solution to the wave equation. That's why we can add (or subtract) the complex solutions to get a real solution.
Response to comment:
$$ e^{ix} = \cos(x) + i \space \sin(x) $$
so replacing $x$ by $-x$ gives:
$$
\begin{split}
e^{-ix} &= \cos(-x) + i \space \sin(-x)\\
&= \cos(x) - i \space \sin(x)
\end{split}
$$
because $\cos(x) = \cos(-x)$ and $\sin(x) = -\sin(-x)$. So subtracting $e^{-ix}$ from $e^{ix}$ gives:
$$
\begin{split}
e^{ix} - e^{-ix} &= \cos(x) + i \space \sin(x) - \cos(x) + i \space \sin(x)\\
&= 2i \space \sin(x)
\end{split}
$$
therefore:
$$ \frac{e^{ix} - e^{-ix}}{2i} = \sin(x) $$
There is no need for the solution $\psi(x)$ to be real. What must be real is the probability density that is "carried" by $\psi(x)$. In some loose and imprecise intuitive way, you may think about a TV image carried by electromagnetic waves. The signal that travels is not itself the image, but it carries it, and you can recover the image by decoding the signal properly.
Somewhat similarly, the complex wave function that is found by solving Schrödinger equation carries the information of "where the particle is likely to be", but in an indirect manner. The information on the probability density $P(x)$ of finding the particle is recovered from $\psi(x)$ simply by multiplying it times its complex conjugate:
$$\psi(x)^*\psi(x) = P(x)$$
that gives a real function as a result. Note that it is a density: what you compute eventually is the probability of finding the particle between $x=a$ and $x=b$ as $\int_{a}^{b} P(x) dx$
As you know, when you multiply a complex number(/function) times its complex conjugate, the information on the phase is lost:
$$\rho e^{i \theta}\rho e^{-i \theta}=\rho^{2}$$
For that reason, in some places one can (not quite correctly) read that the phase has no physical meaning (see footnote), and then you may wonder "if I eventually get real numbers, why did not they invent a theory that directly handles real functions?".
The answer is that, among other reasons, complex wave functions make life interesting because, since the Schrödinger equation is linear, the superposition principle holds for its solutions. Wave functions add, and it is in that addition where the relative phases play the most important role.
The archetypical case happens in the double slit experiment. If $\psi_{1}$ and $\psi_{2}$ are the wave functions that represent the particle coming from the hole number $1$ and $2$ respectively, the final wave function is
$$\psi_{1}+\psi_{2}$$
and thus the probability density of finding the particle after it has crossed the screen with two holes is found from
$$P_{1+2}= (\psi_{1}+\psi_{2})^{*}(\psi_{1}+\psi_{2}) $$
That is, you shall first add the wave functions representing the individual holes to have the combined complex wave function, and then compute the probability density. In that addition, the phase informations carried by $\psi_{1}$ and $\psi_{2}$ play the most important role, since they give rise to interference patterns.
Comment: Feynman is quoted to have said "One of the miseries of life is that everybody names things a little bit wrong, and so it makes everything a little harder to understand in the world than it would be if it were named differently." It is quite similar here. Every book says that the phase of the wave function has no physical meaning. That is not 100% correct, as you see.
Best Answer
I will explain to you the derivation of Euler's formula simply.
define
$$ f(x)=\cos(x)+i\sin(x)\\ \partial_xf(x)=-\sin(x)+i\cos(x)=i(\cos(x)+i\sin(x))=if(x) $$
from this you see that : $f(x)=e^{ix}$.
The reason we keep only the cosine term has nothing to do with the derivation.
We are interested in $\psi(x,t)$. With $\psi(x,t)$ some physical real observable, the idea is then to solve the equation for a complex $\psi$ which is easier and at the end of the calculations impose on your function to be real.
As an exemple consider the harmonic oscillator $\partial^2_x \psi +w^2\psi=0$ , the solution for a complex $\psi$ is $\psi=Ae^{iwx}+Be^{-iwx}$. Asking for a real $\psi$ gives $\psi = A \cos(wx+\phi)$ or equivalently $\psi = A \sin(wx+\phi)$.
So the answer is that, you need to solve your equation for a complex function ( which is simpler) and at the end of your calculations remember that your function mus be real.Which in many cases means taking the real part but not always.