The lengthdir_x() and lengthdir_y() Functions in GML act as simple wrappers for basic trigonometry functions:
Check out this gif,

The blue line represents lengthdir_x, while the red line represents lengthdir_y
The lengthdir functions tell you how far on each axis you have to move, to reach a point a distance away.
In this gif, the circle has a radius of 1, you can see how the lengthdir_x and y change as the mouse moves around the circle.

This is useful for many things, including having one object orbit around another, or spawning bullets at the tip of the player’s weapon while the player can aim in any direction.
here is a quick example of a way to spawn bullets, 32pixels in front of the player, in whatever direction they are aiming.

var aim = point_direction(x,y,mouse_x,mouse_y)//aim is towards the mouse
var len = 32//we want to spawn the bullet 32 pixels away

b.direction=aim//set the bullets direction to our aim
b.speed=10//set bullets speed

These functions can be subsisted for  cos(angle)*distance and  sin(angle)*distance as they are just wrappers for the trigonometry functions