An electronic device is provided. The electronic device mountable on a head of a user includes a display, a sensor configured to capture an image, a processor electrically connected with the display and the sensor, and a memory electrically connected with the processor, wherein the memory includes instructions, which, when executed, cause the processor to provide a guide screen that guides the user to gaze at a front of a display, to capture an image, in which at least a portion of an eye of the user is included, using the sensor, and to determine a wearing state of the electronic device based on at least one of a location of the eye or a location of a pupil of the user displayed in the captured image.