We've all seen the margarita salt along the rim of the glasses in the restaurant. There are some types of salt to use, and others to avoid when making a margarita.
The salt on this glass is large grainedMargaritas originated back in Mexico, where at least parts of the country are close to the sea. Therefore, at least in its origins the salt used in the margarita was sea salt.
Sea salt is a large grained salt, and large grained salts are still the best type of salt to rim your margarita glass with. In addition to sea salt you could also use large grained kosher salt. The term you are looking for when you purchase this type of salt is "coarse."
The salt you want to avoid is table salt, because its grains are too fine and dissolve too quickly on the glass and on your tongue.
There is a technique to getting the salt onto the glass. Essentially you wet the rim of the glass and then dip it into the salt, so that salt will stick to the wet rim.
I suggest wetting the rim with a lime wedge. You can see a full picture demonstration of how to salt a margarita glass here.
When you are dipping the glass into the salt you can just have the salt out on a plate, or you can use a salt rimmer, which is basically a shallow round cup that holds salt dedicated to use in your margaritas.