The old gasket is removed and replaced with a new gasket -- follow the manufacturer's instructions to make sure it goes on straight and does not cross-thread (Image 1).
Replace the tank on the bowl and secure it in place with the existing bolts.
Next, install the new fill valve, making sure the new one matches the same model as the old valve. The valve is secured with a lock nut under the tank, and a flexible tube connects the tank's overflow pipe. The flapper is attached last, again, following the manufacturer's specifications (Image 2).