Is Sram PG850 cassette a substitute for Shimano TZ31 freewheel? I need your advice.

I have a Giant Escape 2014 UK model bike and it's time to change the chain and the original cassette/freewheel, which are worn out.

My question is, if I get this Sram PG850 8-speed cassette, will it fit nicely instead of the original Shimano MF-TZ31 Tourney 7-speed freewheel?
They say Sram cassettes are Shimano compatible but I just want to be sure, I'm rather a newbie to cycling.

Will it combine well with the bike's current Shimano Tourney TX55 6/7 speed rear derailleur and Shimano EZ FIRE 40 21 speed shifters? (I don't mind having only 7 speeds on the new cassette).

Thanks for helping!
SRAM Cassettes are compatible with Shimano Cassettes, but a cassette and a freewheel are different components. You will not be able to use the SRAM Cassette to replace your Shimano Freewheel. You will need to replace your freewheel with a freewheel.  

The difference between a cassette and a freewheel is that a cassette is just a bunch of cogs that slides onto a free hub. This allows the wheel to spin without the chain moving. With a freewheel, the cogs and freewheeling mechanism are all in a single assembly, and this is screwed onto the hub of the bike.