Deductions & credits

Everything you need is in chapter 4 of publication 463. https://www.irs.gov/pub/irs-pdf/p463.pdf

You first need to determine your regular workplace.  It might be your home, if you do a significant amount of administrative work there (billing, scheduling, client calls, etc.).  In that case, and if you qualify to claim your home as a home office (publication 587 https://www.irs.gov/forms-pubs/about-publication-587) then any mileage driving from your home office to clients is deductible. 

If your home is your main place of work but you don't qualify for a home office deduction for other reasons, then your first trip out and last trip back are commuting expenses and not deductible, but trips between job sites you visit on the same day are deductible.

If your home is not your main place of work and you have no regular place of work, then the only mileage that is deductible is mileage between different job sites on the same day.

Personal miles are never deductible.  You will need to keep careful track, and a mapping app may help.  For example, if the distance between client 1 and client 2 is 8 miles, and it takes you 15 miles because you sidetrack for a personal errand, you can deduct the 8 miles it would have taken, assuming you have the records to show it.