只要 (zhǐyào) means "as long as" or "all you need is". It gives a condition that is enough on its own, and 就 (jiù) in the second part gives the result.
只要 + condition, (subject) + 就 + result.
只要 can go before or after the subject of the first part: 只要你努力 and 你只要努力 are both fine. The condition comes first. 就 goes before the verb in the second part, after its subject if it has one.
只要 often says that the condition is easy: just do this one thing and the result will follow. It can also describe a habit, where it is close to "whenever".
只有 (zhǐyǒu) looks similar but means "only if": the condition is the one thing that must happen, and nothing else will do. It goes with 才, not 就. 只要 goes with 就, not 才.
Mixing the two pairs is the most common mistake. 只要你努力,才能学好 and 只有你去,我就去 are both wrong.
Practise this grammar point on paper: 17 exercises using only HSK 3 words, with an answer key on a separate page. Free to print and copy for your class.
Every example on this page uses only words up to HSK 3. Paste your own sentences into the level checker to see which words, if any, are above your level.