Job begins talking about what would have been true if he had died at birth. He is sad that these things are not true. (See: [[rc://en/ta/man/jit/figs-hypo]])
Here the word "rest" means to sleep peacefully in death, but also that Job would not be experiencing the pain that he does. (See: [[rc://en/ta/man/jit/figs-idiom]])