The preview image that appears in the player while a YouTube video is loading is usually a screenshot taken from the exact middle of the video. For example, if a video is 3 minutes long, YouTube will take a screenshot at the 1:30 mark and use it as the preview.
However, YouTube now offers a more flexible option: after uploading a video, you can select "Edit Video," and the system will provide three still images for you to choose as the default video preview. If the video length is X seconds, YouTube will automatically generate three preview images at X/4 seconds, X/2 seconds, and 3X/4 seconds. You can simply click on any of these images to set it as the default preview.