Derailleurs are relatively fine tuned machines and as such are fussy to set up correctly.
Since you are very inexperienced at bike mechanics, I suggest you save yourself a lot of grief
and take your bike to a local bike shop. They will sell you a suitable derailleur, install it and adjust it
for you.