Using dynamic weighting between two loss functions

Hello, I have two loss functions of different magnitudes e.g

loss1 = 0.5
loss2 = 32131313

I’m looking for an appropriate method of balancing the two losses before adding them together for back propagation. Note that both losses change during training and can be negative in some instances. what method can I use to balance both losses at every instance during training?