How to make player move the way the camera is looking?

So i want the player to move the direction the camera is looking, here is my code:

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

public class _PlayerController : MonoBehaviour {

    public float speed = 5f;

    private void Start()
    {
        speed = 5f;
    }

    private void Update()
    {
        transform.Translate(speed*Input.GetAxis("Horizontal")*Time.deltaTime, 0f,speed*Input.GetAxis("Vertical")* Time.deltaTime);
    }
}

It looks like you don’t want to move on the Y Axis.
i suggest taking the camera’s Forward and Right vector, make Y zero and normalize them.

private void Update()
{
	Vector3 forward = Camera.main.transform.forward;
	forward.y = 0;
	Vector3 right = Camera.main.transform.right;
	right.y = 0;
	transform.Translate(forward.normalized * speed * Input.GetAxis("Vertical") * Time.deltaTime);
		transform.Translate(right.normalized * speed * Input.GetAxis("Horizontal") * Time.deltaTime);
}