Basically, you just need 2 floats to represent the horizontal and vertical angles that you are looking at which is called Spherical Coordinates.
Based on the cursor x and y positions we will rotate the player which has the camera attached to it as a child object.
Then for WASD movement, we just use the Player's transform to get the forward direction and add some movement.