A simple way to focus your DSLR for astrophotography without a lot of other expense like a costly knife-edge device or laptop with cabling and focus control software, involves zooming in and reviewing diffraction lines from a bright star near the deep sky target. This method works best with a Newtonian telescope, where the secondary mirror is suspended by 3 or 4 straight flat bars 90 degrees apart within the optical tube assembly.
With diffraction lines, the zoom-review focus method can be accomplished very quickly. Three focus frames taken during the prior night's efforts are shown here.
You always want to try and focus on something nearby, as slewing the telescope clear across the sky can disrupt the mirror collimation on your touchy Newtonian.