There's no better source for this answer than the Internal Revenue Service: "If you use your car in your job or business and you use it only for that purpose, you may deduct its entire cost of operation." There are limits, of course, and the IRS describes those in detail online in Tax Topics under "Business Use of Car." The IRS adds that if you "use the car for both business and personal purposes, you may deduct only the cost of its business use."
The IRS says that you can "generally figure the amount of your deductible car expense by using one of two methods: the standard mileage rate method or the actual expense method."
"If you qualify to use both methods, you may want to figure your deduction both ways before choosing a method to see which one gives you a larger deduction." More details are available in IRS Publication 463, "Travel, Gift, and Car Expenses." Learn more