Expanding on the comment by @DanielHicks, given the symptoms described, it sounds like you are talking about the shifting at the rear of the bike. Chances are that your rear derailer needs adjustment.
Hopefully you don't force the chain on the correct cog by hand - that's what the derailer is for! In any case, when you push a shift lever, it pulls or releases a set amount of cable, e.g. 2.7mm. This will move the derailer a set amount in either direction (not by the same amount of distance, but that's a long story). As they age, however, cables can stretch, and the cable housing will accumulate contamination inside. A click may not pull the cable the intended distance. You can follow the link in Daniel's comment to a guide as to how to adjust your derailer. Also, it's possible that the derailer's top and bottom limits will need adjustment - these two settings govern the range the derailer can travel, and the limits should align with the biggest and smallest cogs. You may not need to touch them if the bike was set up correctly. Anyway, wrongly adjusted cable tension will cause the chain to skip or slip as you described, or if you shift at the lever the chain may not actually make it to the correct cog.
If the chain is too badly worn, then even if the derailer is correctly adjusted, the chain will skip on some of the cogs. Unfortunately, this requires a replacement chain, and possibly a replacement cassette or freewheel. On more expensive groupsets, you should regularly check your chain for wear using a chain checker. If you replace the chain regularly when slightly worn, it will keep you from having to replace both chain and cassette. On cheaper groupsets, it can be acceptable to just let the chain and cogs wear out and change both - but this does accelerate wear on the front chainrings also. It will depend on your mileage and on your costs.
Reading the title, I initially thought you were asking to do what if your chain slipped off the front chainrings. This is likely not what you asked, but the advice here may be generally useful. Sometimes, when shifting to the little ring, you drop your chain off the inner chainring. This can be exacerbated by bumpy terrain. If this happens, you can often shift back to the big chainring and keep pedaling. The chain will often re-engage (if the front derailer was set up correctly). If you are on a steep hill and this happens, then next time you should learn to shift to the small ring earlier - this is not intended as snark, it merely is one of the many small skills we have to acquire as cyclists. Also, if the front derailer's travel limit is wrongly adjusted, this may exacerbate chain drops. Last, as you are able, learn to slightly ease off the pedals as you make a front shift. This reduces the risk of dropping a chain.
Occasionally, you may lose the chain off the big ring, to the outside. This probably means your front derailer's travel limits were wrongly adjusted, but in any case, you can sometimes recover if you shift to the inner ring and keep pedaling (i.e. the obverse of the recovery procedure for chain drop on shifting to the inner ring). Many big chainrings have a pin sticking out - that's called a chain drop pin, and it often catches a chain that falls off.