Can I write off mileage when earning W-2 income?

I also earned a very little amount of 1099 but the majority of the mileage was driven during the time I earned W-2 income.