For cameras with interchangeable lenses, never rely on the infinity mark for true infinity focus. It is ALWAYS best to focus using your eyesight. ALWAYS use manual focus. Follow the seven steps below to achieve a sharp focus on the stars.
Set your camera to Liveview.
Set up your camera to use focus magnification. When focusing on objects in the night sky always use the focus magnification to zoom in.
Initially set your lens focus ring to the infinity mark. This is to get "ballpark" focus. You will need to fine tune focus. If focus is too far off, you probably won't see any stars as they tend to get so blurry that they disappear.
Point your camera at a reasonably bright star. Why? Because they are easier to locate in your Liveview LCD, especially if focus is soft.
SLOWLY turn the lens focus ring until the star is as small of a point of light as you can get.
Look for dimmer stars nearby the brighter one. Why? Because dimmer stars require a better focus to be able to even see them. Even slightly soft focus can cause dim stars to disappear. So if you can make them display and make them as small of a point of light as possible, you will have achieved a good focus.
Take a few test photos and zoom in to verify focus.
And note that it is easier to focus with telephoto lenses than on wide angle lenses. You can only zoom in so far with focus magnification, and WA and UWA lenses are more difficult for our eyes to see the stars on during focusing. So expect to take more time with a 24mm lens than with a 400mm lens.