Move Forward Locally While Still having Collision

I am trying to make a tank game, where w and s move it forwards and back, while a and s turn it left and right. I am also planning to have walls and rigidbodys. I have tried but I can’t find a solution. Please help.

transform.forward gives you the local z vector. Or you could use
Vector3 forward = gameObject.transform.TransformDirection(Vector3.forward);