How can I move the character like 2D games?

Hello, someone knows how I can make the character move like in the “Dont Starve” or “One Hour One Life” games

Add a Rigidbody2D and a Collider2D (for example, a CircleCollider2D) to your player GameObject.
Then, add a script that has this implementation for starters:

private Rigidbody2D rb2d;
public float speed;

private void Awake()
{
    rb2d = GetComponent<Rigidbody2D>();
}

private void FixedUpdate()
{
    // Put input values in a Vector2
    var input = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
    // Clamp the vector to not have a length over 1,
    // otherwise running diagonally would be faster
    input = Vector2.ClampMagnitude(input, 1);

    // Set the velocity of the Rigidbody2D so it moves in that direction
    rb2d.velocity = input * speed * Time.deltaTime;
}

The Time.deltaTime factor is optional, but i personally like speed to be in meters/second, which this enables.

Of course, feel free to experiment with this script to get a feel for what it does.