Learn from millions of experts
Hans de Ridder´s answer must workk, but the other way to do this is select the line and the circle at the same time pressing ctrl key on the keyboard and in the left tool bar will appear the option tangent, then you select the tangent and do the same with the other circle.
But the solid works will automatically adjust the position or dimensions of the line and the circles so maybe if you want an specific dimension or positions you may set them firstAnswered with a tutorial: https://grabcad.com/tutorials/how-to-make-a-line-tangent-on-two-circles-in-solidworks
Set the diameter of the circles to a dimension or equal to each other.
What about simply fixing (anchoring) the circles?
Edit: I thought about it for 5 more seconds and realized that dimensioning is much better. Carry on!
Simple.....You have two circles, than add a line close to the tangent point on the first circle..than do the same for the other circle....solidworks will automatically determine the two real tangent points.