Unexpected Token: if

Hi, im new to unity and scripting so maybe the answer is simple…

But im getting an error: Unexpected token: if
Please someone help me with this error… i tried everything…

{

void :

if(Input.GetButtonDown("FlashDown")){

Transform.Y == -0.5;
Transform.Y = 1.0
else;

Transform.Y = 1.0;
Transform.Y = 0.5

}

try ``if(Input.GetButtonDown(“FlashDown”)){

Transform.Y == -0.5;
Transform.Y = 1.0
}
else{

Transform.Y = 1.0;
Transform.Y = 0.5
}``
it should work

how about

if(Input.GetButtonDown("FlashDown"))
    {
    Transform.y = -0.5f;
    Transform.y = 1.0f;
    }else{
    Transform.y = 1.0f;
    Transform.y = 0.5f;
    }