I mean, sometimes, I write words I don't know helping with what I hear. That's what I did here for "маленький". But everytime, this strange letter "ь" is placed differently. So I tried to know what is his fonction in a word, is there a logic? ( sorry for my bad english, and thank you!)
In this case, it represents the pronunciation. Try looking up words like лень, лист, лыжи, лужа, люк, альт, алтарь on Forvo and try to hear the difference between the different Лs. It is rather drastic.
One should sound similar to L in "leak", the other is very similar to L in "pull".
In Russian, some consonants are pronounced palatalised (with the middle of your tongue raised). You can generally determine it by looking at the following vowel letter. If there is no vowel after a consonant, you can mark its palatalisation using the soft sign (e.g., панель, конь, лошадь, большой)
If a Russian consonant is followed by а, э, ы, о, у you pronounce it as in the alphabet. If it is rather followed by я, е, и, ё, ю, you pronounce the consonant with the middle of your tongue raised ( palatalised or "soft" consonant).
- most Russian consonants come in non-palatalised / palatalised pairs (exactly 15: б, в, г, д, з, к, л, м, н, п, р, с, т, ф, х). Some, however, have their palatalisation fixed: й, щ, ч are perma-soft, ж and ш are always non-palatalised.
Also, check Russian grammar channel, which needs more love.