Disclosed is an electronic device. The electronic device according to an embodiment includes a memory and a processor electrically connected with the memory, wherein the processor is configured to obtain an identification of a portion of the media data and a sequence of heart rate (HR) data of a user of the electronic device while the portion of media data is output, and store, in the memory, the identification of the portion of the media data when the HR data sequence satisfies a specified condition.