Having trouble getting 2D movement to work

I tried to make a 2D movement script in unity 2D, i keep getting errors that say nothing that makes sense to me, heres all the code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movement : MonoBehaviour
{   
    private float Speed = 0f;//will be changed by other floats, DO NOT CHANGE
    public float MaxSpeed = 10f;//This is the max speed that the player can go up to
    public float Acceleration = 10f;//How fast the MaxSpeed is reached
    public float Deceleration = 10f;//How fast no movement is reached

    public Animator anim;
    
    void Update() 
    {   
        float direction = Input.GetAxisRaw("Horizontal");  

        Debug.Log (direction); 
        //left is -1
        //nothing is 0
        //right is 1

        anim.SetFloat("Speed", Mathf.Abs(Speed));
        
        if (direction = 1) //Right
        {
            if (Mathf.Abs(Speed) > MaxSpeed)
            {
                Mathf.Abs(Speed) = MaxSpeed; //If Speed is over MaxSpeed, set it to maxSpeed
            } else
            {
                Speed = Speed + Acceleration * Time.deltaTime; //else acceleration is added
            }
        } else if (direction = -1) //Left
        {
            if (Mathf.Abs(Speed) < MaxSpeed)
            {
                Mathf.Abs(Speed) = MaxSpeed; //If Speed is over MaxSpeed, set it to maxSpeed
            } else
            {
                Speed = Speed - Acceleration * Time.deltaTime; //else acceleration is minused
            }
        } else
        {
            if (Speed > 0) //Right
            {
                Speed = Speed - Deceleration * Time.deltaTime;
            } else if (Speed < 0) //Left
            {
                Speed = Speed + Deceleration * Time.deltaTime;
            } else
            {
                Speed = 0;
            }
            
            //transform.position = transform.position + new Vector3(Speed * Time.deltaTime, 0, 0);
            
        }
        transform.position = transform.position + new Vector3(Speed * Time.deltaTime, 0, 0);
    }
}

heres the errors I’ve been getting as well
image

you need to change in code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movement : MonoBehaviour
{
private float Speed = 0f;
public float MaxSpeed = 10f;
public float Acceleration = 10f;
public float Deceleration = 10f;
public Animator anim;

void Update()
{
    float direction = Input.GetAxisRaw("Horizontal");
    Debug.Log(direction);

    // Set the "Speed" parameter in the animator to the absolute value of Speed
    anim.SetFloat("Speed", Mathf.Abs(Speed));

    if (direction == 1) // Right
    {
        if (Mathf.Abs(Speed) > MaxSpeed)
        {
            Speed = MaxSpeed; // Set Speed to MaxSpeed directly
        }
        else
        {
            Speed = Speed + Acceleration * Time.deltaTime;
        }
    }
    else if (direction == -1) // Left
    {
        if (Mathf.Abs(Speed) > MaxSpeed)
        {
            Speed = -MaxSpeed; // Set Speed to -MaxSpeed directly for left movement
        }
        else
        {
            Speed = Speed - Acceleration * Time.deltaTime;
        }
    }
    else
    {
        if (Speed > 0) // Right
        {
            Speed = Mathf.Max(Speed - Deceleration * Time.deltaTime, 0); // Ensure Speed doesn't go negative
        }
        else if (Speed < 0) // Left
        {
            Speed = Mathf.Min(Speed + Deceleration * Time.deltaTime, 0); // Ensure Speed doesn't go positive
        }
    }
    
    transform.position = transform.position + new Vector3(Speed * Time.deltaTime, 0, 0);
}

}

thank you that worked