Represent the car's velocity using a vector (or using two variables). Also, represent the position and orientation of the wheels in memory.
When the car is moving, check the car's angular velocity. Use that to derive the velocity of the wheel from the car's angular velocity; add that to the car's velocity. Decompose the resulting vector into two vectors: first, along the wheel's rolling direction, and second, perpendicular to the first. Calculate the friction of both. The one along the wheel's direction gets less friction, and the one perpendicular to the first vector gets more friction. Repeat for all four wheels. Calculate the change in angular momentum when applying the friction forces. Change the angular velocity based off this value. Finally, modify the car's velocity based on its mass and the friction forces.
You can identify how much "drift" is happening by checking the magnitude of the movement of the wheels perpendicular to their direction. Using this information, you might wish to add tire tracks under each wheel.
Using this description, it should be possible to Google up the math, and you should be able to convert the math into code. (I hope you're good at algebra!)