That's one of it's basic functions other than lubrication. That's why when you change your oil. You put nice clean golden colored oil in, and 5,000 miles later it comes out dirty dark brown or black.
Change the car’s oil every 3,000 to 5,000 miles, along with the oil filter.
Keeping it clean, free from dirt and dust, extends the life of the engine.