The electronic device includes a capsule unit for accommodating a plurality of capsules, a discharging unit for discharging the substance contained in the capsule, a communication unit for transmitting data to or receiving data from the external device, and a control unit, The control unit may receive the user status information and the biometric information from the external device through the communication unit, select at least one capsule in the capsule unit based on the received user status information and the biometric information, It is possible to determine an injection amount of the substance contained in the capsule, and to control the operation of injecting the substance through the discharge portion.전자 장치는, 복수의 캡슐을 수납하는 캡슐부, 상기 캡슐에 포함된 물질을 토출시키는 토출부, 외부 장치로 데이터를 전송 하거나 또는 상기 외부 장치로부터 데이터를 수신하는 통신부, 및 제어부를 포함하고, 상기 제어부는, 상기 외부 장치로부터 상기 통신부를 통해 사용자 상태 정보 및 생체 정보를 수신하고, 상기 수신된 사용자 상태 정보 및 생체 정보에 기초하여 상기 캡슐부에서 적어도 하나의 캡슐을 선택하고, 상기 선택된 적어도 하나의 캡슐에 포함된 물질의 분사량을 결정하고, 상기 토출부를 통해 상기 물질을 분사하는 동작을 제어할 수 있다.