If have just started to learn Russian and have come across the fact that 'ь' remains silent but changes the sound of the letter that comes before it (I think). Please can someone give me an example of how e.g. ять and ят would sound different.
If you're British, then you probably already use a soft [t] in the word tune, as compared to how we Americans say the same word. You basically say тюн and we say тун. If you can, isolate the first consonant in both pronunciations, and you will get the gist of what happens phonetically when you pronounce a Russian soft consonant. Basically, you're producing the target sound, but with your tongue wanting to form a [y] sound at the same time. Very often, English speakers who are learning Russian get away with just saying a full [y] after the target sound, which is wrong. The idea is to produce the target consonant WHILE the tongue is in the [y] position as one articulation.
BTW, you can do the same for -дь- with dune (Brit. дюн Am. дун)
i can supply an explanation involving spanish, if of course you have some knowledge of it.
the russian sign "ь" changing the sounding of previous letter in the similar way as "~" upper sign changes sounding of simple "n" in spanish. (ñ=нь, Ñ=Нь. one sample of transliteration - niño=ниньо, try in cyrillics this word in google search)
however unlike spanish, russian "ь" sign may change the pronuncation into similar way of almost any consonant that it follows after.
so "ять" is not actually [yat], but rather [yat'] and "ят" is then [yat]. note the appearing apostrophe in the first one.
if you don't have access to some spanish source, then there is also may be an explanation. try to imangine how the previous consonant would sound if it would stand before the i/y letter in two words combination where the second is starting with i/y, as in phrase, got you - gotcha(got'cha). as you see the "t" in "got" have changed. in the same way all the letters with "ь" following are changed in russian.
Ять is made of two sounds: я [ya] and ть [t']. Second sound, soft T, you can hear in a few english words such as tea, terminate (first t), estimate (first t). Russian examples are мать, тигр, тяжба. But remember that [t'] in russian is much softer than in english. Ят is also made of я [ya], but here T is hard and pronounced like [t]. For example, in english train, track, tomb, in russian твердь, торг, трамвай. Also, like it is advised above, watch some youtube videos (cs:go with russian teammates, they swear a lot, and swearing in russian is the best way to understand pronunciation of ять), or listen to google translator.