To do this, you need to follow all the appropriate camera settings. Use manual mode and adjust the camera according to the weather. The most important thing is to set the exposure correctly. Then you can get a photo without star trails.