They look quite similar in the usage but actually they're different.
First of all, the meaning is slightly different. For instance,
나는 방금 일을 마쳤다.
---> (I just finished my work, which means something is done just right before.)
나는 금방 일을 마쳤다.
---> (I just finished my work , and also means I finished my work before long, which means it didn't take long time to finish it.)
People sometimes confuse both of them as they are used all past sentence. In fact, they're different.
Plus, it the aspect of tense, "방금" and "금방" can be all used in the past sentence, only "금방" is available in the future tense. For instance,
"금방 올께" (I'll be back soon), which is grammatically correct. Meanwhile
"방금 올께" isn't acceptable in the future sentence.
Hope it would be helpful for you!