Often the nails used to install siding have smooth shanks and are shot with a pneumatic nailer. It's easy to miss the house frame when nailing and have some loose siding.
I renail loose siding where needed as part of the exterior painting preparation. Also I use ring shank nails.
If a nail is loose but into the framing lumber then simply pull it out and replace with a ring shank nail of the same length. If a nail has missed the lumber then you will need to renail, this time hitting the frame. Fill open nail holes with caulking.