There are some rules for use "ь" in the Russian language. In the words as "компьютер", "ь" (soft character) is the separation character. We use it before "я" [ja], ё [jo], е [jэ], ю [ju], и [i] inside the words, but not after the prefix. For example: "серьёзный", "вьюга", "соловьиный". After the prefix we use separation character "ъ": "объект", "двухъярусный", "трансъевропейский".
In the words "гольф", "фильм" - "ь" is literally the soft character: we use it to soften sounds in the words. This is peculiarity of the pronunciation of many words in the Russian language.