The first one you'll need an old two-prong freewheel tool. Not the BMX size one, it's a bit smaller. Second Shimano one looks like a Uniglide cassette. You need two chain whips, one to hold the cassette cogs and the other one you use to unscrew the smallest cog. The rest of the cassette then slides off the splines. Don't chuck it out, Uniglide is rare.