If your hubcaps are loose, it's likely because the clips that hold them in place are worn out. You can try to tighten the clips, but if they're too worn, you'll need to replace them.
To tightening the clips, start by removing the hubcap. There will be a series of small metal tabs around the edge of the hubcap. Using a flathead screwdriver, pry up on these tabs until they're all raised equally. Once they're raised, you should be able to snug up the hubcap so it's tighter on the wheel.
If the tabs are too worn to raise or if they break off when you try to pry them up, you'll need to replace the clips. You can find replacement clips at most auto parts stores or online retailers that sell automotive parts and accessories.