The system which are considering is the mass $m$ and it has three external forces acting on it.
I know the spring is modeled as $F_{\text{elastic}} = k\cdot x$.
The force on the mass due to the spring is $-kx$.
When the extension $x$ is positive (assumed downwards from the diagram) the spring is pulling the mass up.
The damping force opposes the motion so when the mass is moving down with $\dot x$ positive the force opposing the motion must be upwards.
So the retarding force is $-c\dot x$.
This is the right form for this equation because when the mass is moving up $\dot x$ is negative then $-c\dot x is positive ie downwards and so still opposing the motion.
To set up the equation of motion using Newton’s second law you should gather up all the forces on the left hand side
$F_0\sin \omega t -kx -c\dot x = m\ddot x$
and put this net force equal to the mass times its acceleration.