Focus has to be performed manually. As Keith points out, you won't get auto-focus to work on the stars because their not bright enough for the camera.
If the moon is in the sky, you can use that to focus. But the moon generates light pollution which washes out what you'll be able to see in the night sky -- the best images are taken when the moon isn't in the sky (so you wouldn't be able to use the moon.)
Normally you'll need to (a) switch on live view, (b) set a very high over-exposure (deliberately), (c) zoom in the live-view to the maximum amount possible (e.g. the 10x level if that's what your camera supports) and carefully inspect the quality of focus on a bright star (and use a star... if there are planets in the sky a star will provide more accurate focus.)
I use something called a Bahtinov focusing mask. It works like a lens cap (or thread-on filter) and it attaches to the front of the lens. It has slots cut in it. It's designed so that as you focus a star, the star will throw "diffraction spikes". You'll see a pair of spikes in the shape of an "X" with a third spike that goes through the X. When all three sets of spikes converge at the same center point, the image is perfectly focused.
Here's an example:
Bahtinov mask - Wikipedia, the free encyclopedia
I use a mask made by Gerd Neumann (that's the brand) and this attach just like a lens filter. But the Gerd Neumann masks are a bit pricey. A much more affordable option are the Farpoint brand masks -- just a piece of cut plastic that presses in to the threads on one of your existing lens filters -- so if you have a clear or UV filter you can attach the Farpoint mask to your UV filter and thread it on to the lens. You can also use astrojargon.net website to generate, download, and print your own template if you want to cut your own mask (and that's free).
Sometimes ... especially with an ultra wide lens which really minimizes the stars... it's difficult to do a live focus and I have to take a multi-second image to evaluate and tweak focus.
This sometimes takes a while to nail the focus. I HIGHLY recommend you not rush through this... if it takes 15 minutes of effort just to focus, it will be worthwhile in the results that you get after you spend your time taking lots of long exposure images (you'd be disappointed if you spent all night and the images are all soft.)
One other thing -- it was implied but maybe maybe not obviously stated -- is that if anything in the night sky is focused, then everything in the night sky is focused. That means if the area of the sky doesn't have anything bright enough to achieve focus... just point your camera in an area where you can more easily achieve focus.
Lastly, don't forget to return your camera to your intended exposure settings (instead of max exposure) and remove the focusing mask (if you used one) before starting to image.