Below step by step to edit or change hostname of Junos OS:

Enter to the configuration mode.

configure

Then we edit the system.

edit system

Set hostname by using the following command.

set host-name Junos

Above we use Junos as the hostname.

Finally, we commit the changing of hostname by using the following command.

commit