What is the proper way to check if an object exists?

GameObject ship = GameObject.Find(“Ship”);
Move movescript = ship.GetComponent();

sometimes this is called after Ship is dead, which causes a null reference exception on getComponent. What is the proper way to test this before making the getcomponent call?

Basically you need to check if the ship still exists like so:

if (ship) // i.e if the ship exists and is not null
{
    Move moveScript = ship.GetComponent();
}