Are they cold? Wandering on cold floors like tile or even wood can be enough. A little doggy jacket might help...
Was someone/something making them nervous? If it was strangers in the house, slowly and calmly introduce them to the people, one at a time. Hold or pat your dog, and allow the dog to sniff at the person before they pat. Avoid other peoples children, they can completely accidentally do serious damage to a small dog. Giving the dog a safe, quiet place, like a basket in the corner of the living room, might help.
In general, to calm any kind of dog, you should talk to them very quietly and slowly, keeping the pitch of your voice low (if you're female). Approach them slowly, crouch down so you don't seem so big, and stroke them from head to tail in slow, long strokes. Don't scruff them behind the ears.
To help you further we need to know - what kind of dog (poodle? chihuahua? cockapoo?), how old is it, how long has it lived with you, is it a shelter dog, and in what scenarios is it shaking (just random? when excited? when it sees another dog? when people come over?).