Improve unity 2D collider

Hello, i made a small 2D JumpAndRun game, and i wondered if there is a way to improve the BuildIn collider of unity?
Because currently the player is able to get stuck in walls just by walking into them.
Is there a way to prevent this?
Maybe with another movement script?

            movementX = Input.GetAxisRaw("Horizontal");
    
            transform.position += new Vector3(movementX, 0f, 0f) * Time.deltaTime * moveSpeed;

Its probably not about the Collider. Unity has RigidBody2D component which is used to handle physics for dynamic bodies. In other words every moving body has to have a RigidBody2D component if you need to compute physics on the body. It is best to move the bodies using the RigidBody2D component instead of Transform component for correctly computing the collision detection. Anyway it may still stuck to walls. You can try to make a PhysicMaterial2D with no friction and put it on the player. That could be it.