In forward prop we are working from input to output from left to right but how we need to multiply the terms from one layer to other and how do we choose bias and weight .what is j in the calculation

J is the cost.

The weights and bias values are learned through training. This gives the weights and biases that minimize the cost.