I install windows in my SSD and also installed Ubuntu in my HDD. How can I get rid of window in SSD and replace it with Ubuntu in HDD, but also delete Ubuntu in HDD
This is probably a bad answer, but in all of my experience with migrating between drives, the best possible solution is to do a fresh install on the new drive. After that you can leave both drives in the system, and copy over your files.
It is possible to directly bit copy the contents of one drive to another if the new drive is larger than the old drive.
Afterwards the partition table and file systems need to be expanded to the new drive. Utilities for this task tend to be of dubious quality, particularly in the Linux realm. Migrating to a smaller drive requires the file systems to be shrunk, which is kind of a hack since most file systems are not designed with shrinking in mind.
Anyways, do yourself a favor and just freshly install Ubuntu on the ssd.
To zero the old drive (after you have copied all of the data), figure out what device it is, and then bit copy over it from /dev/zero.