How can I make the character movement realistic?

Hi,
I have started with unity coding a few days ago and have some experience in JavaScript as well as C#.
So I developed the following script for a spaceship but the spaceship moves very unrealistic (like it stops immediately after releasing button and is not moving really realistic. I tried to add a rigidbody and tried multiple things with add force and stuff but it didn’t really work. Can anyone tell me how I can add a realistic acceleration and movement as the space key is pressed, and a realistic braking as the space key is released?
The Script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour {
	public GameObject character;
	private float turnSpeed = 80.0f;
	private float acceleration = 0.5f;
	private float maxSpeed = 50.0f;




	void Start () {

	}


	void Update ()
	{


		if (Input.GetKey (KeyCode.Space)) {
			transform.Translate (0, -acceleration * Time.deltaTime, 0);
			if (acceleration < maxSpeed) {
				acceleration += 1;
			}
			if (Input.GetKey (KeyCode.D)) {
				transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
			}
			if (Input.GetKey (KeyCode.A)) {
				transform.Rotate (Vector3.up, -turnSpeed * Time.deltaTime);
			}
			if (Input.GetKey (KeyCode.W)) {
				transform.Rotate (Vector3.right, turnSpeed * Time.deltaTime);

			}
			if (Input.GetKey (KeyCode.S)) {
				transform.Rotate (Vector3.left, turnSpeed * Time.deltaTime);
				//transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime, Space.Self);

				//if (Input.GetKeyUp (KeyCode.Space)) {
				//rigidbody.velocity = rigidbody.velocity * 0.9;
			}
		}
	}

See if this works for you.
I’m checking when spacebar was pressed and released in order to increment or decrement the acceleration value.
Feel free to change the values if you want.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
    public GameObject character;
    private float turnSpeed = 80.0f;
    private float acceleration = 0.0f;
    private float accelerationMax = 0.01f;
    private float maxSpeed = 50.0f;

    private bool decelerating = false;


    void Start()
    {

    }


    void Update()
    {

        if (Input.GetKey(KeyCode.Space) && !decelerating)
        {

            if (acceleration <= accelerationMax)
            {
                acceleration += 0.001f;
            }

            transform.Translate(0, -acceleration * Time.deltaTime, 0);
            if (acceleration < maxSpeed)
            {
                acceleration += 1;
            }
            if (Input.GetKey(KeyCode.D))
            {
                transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
            }
            if (Input.GetKey(KeyCode.A))
            {
                transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);
            }
            if (Input.GetKey(KeyCode.W))
            {
                transform.Rotate(Vector3.right, turnSpeed * Time.deltaTime);

            }
            if (Input.GetKey(KeyCode.S))
            {
                transform.Rotate(Vector3.left, turnSpeed * Time.deltaTime);
                //transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime, Space.Self);

                //if (Input.GetKeyUp (KeyCode.Space)) {
                //rigidbody.velocity = rigidbody.velocity * 0.9;
            }
        }


        if (Input.GetKeyDown("space"))
        {
            decelerating = false;
            acceleration = 0.0f;
        }

        if (Input.GetKeyUp("space"))
        {
            decelerating = true;
        }

        if (decelerating)
        {
            if (acceleration > 0)
            {
                acceleration -= .7f;
                transform.Translate(0, -acceleration * Time.deltaTime, 0);
            }

            else
            {
                decelerating = false;
            }
        }

    }

}