It depends on the vacuum cleaner on where the cause of the loss of suction is.
If it's an upright vacuum cleaner then the loss of suction could be due to dirty air filters, hose obstruction or even the little hose that the beater throws dirt up through.
Check the filters and hoses for any obstructions or clogged dirt and clean them up and the suction should return.
However the same thing can hold true about the filters being clogged or the hoses being clogged for a shop vac or other canister vacuum.
Make sure you keep the hoses cleaned out and the filters cleaned as well so the vacuum can create suction.
If that's not i t then the motor could be going bad and spinning around fast enough to create the suction or the fins to the vacuum cleaner motor which create suction could have broke off.