How would you translate this sentence into Russian “I don’t know if I speak Russian well?” If you turn to the Google Translate for help, it will possibly give you the answer like this: “Я не знаю, если я говорю по-русски хорошо.” Sorry, Google Translate, no offence, but this sentence is incorrect. The correct answer is “Я не зна́ю, говорю́ ли я по-ру́сски хорошо́.”
Let’s give the respectful translation device another chance - have it translate the sentence “I will speak Russian well if I study much.” This time, it comes up with the following answer “Я бу́ду говори́ть по-ру́сски хорошо́, е́сли бу́ду мно́го занима́ться.” Actually, the machine translates the word IF correctly – ЕСЛИ. (The sentence is already corrected by me since Google Translate is not really familiar with the peculiarities of Russian and English grammar.)
How come, two different Russian words ЕСЛИ and ЛИ are used for one English word IF? Well, that’s the case of so-called “easily confused words”. Is there any rule that even Google Translate doesn’t know? Absolutely, and it’s pretty easy. If you can replace IF with WHETHER, use ЛИ. Don't forget that ЛИ goes after the verb (or other word that it is related to), but not before.
If you need more detailed grammar explanation
We use ЕСЛИ in the conditional sentences with two clauses, where one clause starts with ЕСЛИ and shows the condition, and the other clause shows the result. For example,
Если пого́да хоро́шая, мы обы́чно хо́дим в го́ры. = If the weather is nice, we usually go to the mountains.
Мы пойдём в го́ры, е́сли пого́да бу́дет хоро́шая. = We will go to the mountains if the weather is nice.
Мы бы пошли́ в го́ры, е́сли пого́да была́ бы хоро́шая. = We would have gone to the mountains if the weather were nice.
We use ЛИ in the sentences with indirect and embedded yes/no questions. For example:
Она спросила, пойду ли я в горы. = She asked if (whether or not)) I would go to the mountains. (The indirect yes/no question from Ты пойдёшь в горы?)
Он не зна́ет, пойдёт ли он в го́ры. = He doesn't know if (whether or not)) he will go to the mountains. (The embedded yes/no question Он пойдёт в горы? inside the statement.)
Интере́сно, бу́дет ли хоро́шая пого́да. = I wonder if (whether or not) the weather will be nice. (The embedded yes/no question Будет хорошая погода? inside the statement.)