I want to add diffuse function (in basis set) to O, F, and Cl atoms in the molecule but not to H, C, Si atoms. How to write the input file in Gaussian 16?
As mentioned before, you should use the gen keyword. Here you have an example:
# opt freq b3lyp gen int=ultrafine
0 1
coordinates
C H Si 0
6-31G*
****
O F Cl 0
6-31+G*
****
This is the easiest way, by defining two different basis sets for these atoms. Alternatively, you could use the same basis set for all the atoms and then just add the diffusion functions (you need to get them from the basis set exchange database) to the atoms you want. The two options are equivalent. Hope this helps.