I want to ask shall I use "will" or " be going to " when the sentence appears the word "if"?
I tried " will" in the sentence: She...(fail) her test if she still does not study.
The use of if does not effect the meaning or usage in your examples.
She will fail if she does not study.
She is going to fail if she does not study.
A subtle nuance is "will" makes it sound more definite that something happens.