As discussed in the comments of your question the general case of sorting a whole org-tree does not make sense.
But, you can sort the entries on the first level of a (sub-)tree below a heading with org-sort
with respect to the scheduled time.
Place point on the tree heading and call M-x org-sort
RET. Afterwards press s for the scheduled time.
This command changes the org buffer
* Sorting
** TODO do something
SCHEDULED: <2018-01-29 Mon 22:00>
** TODO do the second thing
SCHEDULED: <2018-01-29 Mon 10:00>
** TODO do the first thing
SCHEDULED: <2018-01-29 Mon 08:00>
into:
* Sorting
** TODO do the first thing
SCHEDULED: <2018-01-29 Mon 08:00>
** TODO do the second thing
SCHEDULED: <2018-01-29 Mon 10:00>
** TODO do something
SCHEDULED: <2018-01-29 Mon 22:00>
If you prefer menu handling you can call org-sort
with
Org->Edit Structure->Sort region/children
.