How do I use a sprite in my project?

I’m trying to create a spaceship game. I wanted to use a sprite in my project. Here is a part of the code. I hope you understand.

function update (time, delta)

{
if (cursors.left.isDown)
{
ship.x -= speed * delta;
}
else if (cursors.right.isDown)
{
ship.x += speed * delta;
}

else if (cursors.up.isDown)
{
    ship.y -= speed * delta;
}
else if(cursors.down.isDown){
    ship.y += speed * delta;
}

}

Okay, I’m going to take a look at that code. Thank you.

I’m using phaser 3. I think that’s why I’m not getting it.