How do you use Math.sin and Math.cos

I know my trigonometry but I have no idea how to put it into code
I have to variables
speedX and speedY
I want the direction to go to my mouse

Sorry its hard to explain I hope you understand