For both photography and visual work the good old "Hartmann mask" https://www.iceinspace.com.au/index.php ... 87,0,0,1,0. I have used my version of this on some of my smaller scopes in the past. It works well and is inexpensive to make. (I used the bottom of an old butter container).
Also there are Bahtinov Masks. These work similar to the Hartmann but I found the Bahtinov is a bit more 'accurate'. These can be purchased from most telescope vendors, and you can even make one yourself!! https://www.deepskywatch.com/Articles/m ... -mask.html
I'm now using electronic focusers on my telescopes so for deepsky I'm using the 'autofocus' tools that most of the capture software provides.
For Solar, Lunar and planetary it's a little more difficult. Sharpcap uses a method to autofocus, but I personally haven't had a lot of luck with it for solar images. The constant in and out of focus because of the atmosphere. The waviness is caused by turbulence in the atmosphere, so there's not much that can be done to combat it. Taking video of the object rather than trying to capture a single shot is one way. Using stacking software like Astrosurface http://astrosurface.com/pageuk.html or AutoStakkert https://www.autostakkert.com/ will allow help you select the best images to stack.
I would like to hear what others are doing.