For example, if you want to make a clean tar file of the directory "my_files", you could do the following:
# copy my_files to the Desktop, excluding extended attributes
cp -rX ~/Documents/my_files ~/Desktop/my_files
# go to Desktop
cd ~/Desktop
# create the tar file, excluding .DS_Store files
tar cjvf my_files.tar.bz2 –exclude .DS_Store my_files
# remove the copy
rm -r my_files