How to decide which bytes will form a packet ?(computer networks)
A packet is a sequence of bytes. Nothing more, nothing less. 

When transmitting packets, a signal is formed in such a way that boundaries between packets are easily identified, and that the bytes forming the packets can be transmitted and decoded by the receiver. 

Electrical signals at high frequencies must be formed in such a way that they are not damaged during transmission. A digital signal (low signal = 0, high signal = 1) at high frequency has no chance to survive transmission because of higher frequencies added by sharp signal changes. 

In addition, information for error detection and correction is added before transmitting and checked + removed after receiving the signal, so a package that is sent cannot only be received, but checked for correctness. 

(The actual way the signal is formed will only be known by a handful of highly specialised engineers. It's no secret, just very difficult and not of any interest to most people. As I said in a comment, "applied magic").