The retina is the visible component of the nervous system that links directly to the brain; hence, analyzing and extracting features of the retinal fundus image is essential in ophthalmology. Unfortunately, most retinal fundus images suffer from degradation or distortions, resulting from different imaging qualities during capture and infection by a disease of the eye, such as Glaucoma, Retinoblastoma, Diabetic Retinopathy (DR), Myopia, and Macular Edema. As a result, these changes make it difficult to identify regions of the retina that assist in diagnosing the disease. For instance, many retina diseases diagnosis is impossible to detect without detecting the optic disc (OD) correctly. All these issues motivate us to suggest an algorithm for the localization of the OD that is important for assisting in diagnosing some eye diseases. The proposed algorithm includes several stages. Firstly, we focus on gathering seventeen datasets that make the suggested algorithm more popular, where a group of images belongs to four datasets used in training and the rest in testing. Secondly, the quality of the image improves in three steps, crops the Field of View (FOV), which carries essential information in the retinal image, removing pixels at the top and bottom of the FOV because they represent redundant information, and we suggested a new method for enhancing the illumination and contrast of the retinal fundus image. Thirdly, we proposed using a You only look once (YOLO) for the localization of OD. The method locates the OD exactly (drawing box around the OD and each side of the box touches the OD), not the region around it as in the previous methods. The current method works excellently with all the challenges that may face in the detection and localization of the OD. The proposed model tested with about 6000 different images from various datasets and challenges The accuracy obtained was 100% with an average time of 0.19 seconds. These results were very good compared with previous works in terms of accuracy, average time, and the number of tested images.