To fix atoms during a quantum calculation (or MD simulation), you have to be careful. There are few methods you can do it, you can either fix the coordination of each atom or put a force on the atoms (strong enough to hold the atoms), however, before you do it, you need to figure out a proper explaination on why you want to fix the atoms.
The method to fix the atoms depends on softwares you use, it is usually not complicated, you can find the operation on the manual. Still, the most important thing is to figure out why you want to fix atoms.
If you use Gaussian package, I can fix the atoms in their Cartesian coordinate. You could use the keyword, "opt=modredun" and then fix the bond length, angle or dihedral you need by the letter "F" at the end of your input with the numbers of atoms.
For example,
# opt=modredun B3LYP/6-31G
Tile Card Required
Charge & Multiplicity
Cartesian coordinate
1 2 F
It refers you need to fix the distance of atoms at positions 1 and 2, you identify the labels of atoms by GaussWiew.
Obviously it depends on the package you are using. If it is yours, you can fix atoms positions through lower and upper bounds and use projected gradients.