Question about HDD and SSD drives.

So recently my old PC died. I have some files that i absolutely need to recover. I bought a new PC, built it, and now here comes my question. Can I just plug my old SSD and HDD drives to new MB, recover important files and format old disks? Important files are on both drives, and there is a whole system on the old SSD ( windows, etc. )