An electronic device comprising: a display; at least one wireless communication circuit configured to be wirelessly connectable to a stylus pen; at least one processor operatively connected to the display and the wireless communication circuit; and a memory operatively connected to the at least one processor, wherein the memory stores instructions that, when executed, cause the at least one processor to: display (1110, 1250) a user interface on the display including a plurality of graphical objects each corresponding to a function of the user interface; enter a mapping mode for mapping a function corresponding to a graphical object with a user input using the stylus pen; identify at least one graphical object among the plurality of graphical objects of the user interface that can be mapped with a user input using the stylus pen; provide graphic effect to the identified at least one graphical object distinct from another graphical objects among the plurality of graphical objects of the user interface; detect (1120, 1260) contact or proximity of the stylus pen to a location within the user interface corresponding to a first graphical object of the identified at least one graphical object provided with the graphic effect; receive (1130, 1270) a first user input of a first stylus pen input type using the stylus pen through the wireless communication circuit, while the stylus pen is in contact or proximate to the selected graphical object; and in response to the first user input of the first stylus pen input type, map (1140, 1280) the first stylus pen input type to the function corresponding to the first graphical object. a display; at least one wireless communication circuit configured to be wirelessly connectable to a stylus pen; at least one processor operatively connected to the display and the wireless communication circuit; and a memory operatively connected to the at least one processor, wherein the memory stores instructions that, when executed, cause the at least one processor to: display (1110, 1250) a user interface on the display including a plurality of graphical objects each corresponding to a function of the user interface; enter a mapping mode for mapping a function corresponding to a graphical object with a user input using the stylus pen; identify at least one graphical object among the plurality of graphical objects of the user interface that can be mapped with a user input using the stylus pen; provide graphic effect to the identified at least one graphical object distinct from another graphical objects among the plurality of graphical objects of the user interface; detect (1120, 1260) contact or proximity of the stylus pen to a location within the user interface corresponding to a first graphical object of the identified at least one graphical object provided with the graphic effect; receive (1130, 1270) a first user input of a first stylus pen input type using the stylus pen through the wireless communication circuit, while the stylus pen is in contact or proximate to the selected graphical object; and in response to the first user input of the first stylus pen input type, map (1140, 1280) the first stylus pen input type to the function corresponding to the first graphical object. display (1110, 1250) a user interface on the display including a plurality of graphical objects each corresponding to a function of the user interface; enter a mapping mode for mapping a function corresponding to a graphical object with a user input using the stylus pen; identify at least one graphical object among the plurality of graphical objects of the user interface that can be mapped with a user input using the stylus pen; provide graphic effect to the identified at least one graphical object distinct from another graphical objects among the plurality of graphical objects of the user interface; detect (1120, 1260) contact or proximity of the stylus pen to a location within the user interface corresponding to a first graphical object of the identified at least one graphical object provided with the graphic effect; receive (1130, 1270) a first user input of a first stylus pen input type using the stylus pen through the wireless communication circuit, while the stylus pen is in contact or proximate to the selected graphical object; and in response to the first user input of the first stylus pen input type, map (1140, 1280) the first stylus pen input type to the function corresponding to the first graphical object.