For my games, I place this in the step event:
//defines a dummy variable for image_index
imagenum = image_index;
//checks for the correct animation frame
if floor(imagenum) = stepimage then
{
//checks if sound playing
if sound_isplaying(sound1) = 0 then
{
sound_play(sound1);
}
}
//checks for the correct animation frame
if floor(imagenum) = stepimage2 then
{
//checks if sound playing
if sound_isplaying(sound2) != 0 then
{
sound_play(sound2);
}
}
imagenum is just a variable that takes of the object's image_index so that it isn't modified. stepimage is the frame number of your walk animation when your character is stepping with one foot, and stepimage2 is the character stepping with the other foot. Sound1 and sound2 are the different step sounds associated with the animations.
[Note] The only reason I round the image_index is because I have some irregular image_speeds :/
pier's method works perfectly fine too, but I prefer mine because it will only play the sounds when the character appears to be stepping.