The easiest and most common solution to hold your rug to the floor if it is carpeted is to purchase a rug pad. Measure the size of your rug and purchase a pad that is the same size or slightly larger. You can trim the pad down to match your rug. Roll the rug up and set it aside. Place the pad on the floor in the rug's location, and then roll the rug back into place over the pad. The rug pad will gently adhere to both the carpet and the rug, keeping it from slipping out of place. An added benefit is that it will also provide extra padding, making the rug feel softer under your feet.
If you have tile or wood floors, double-sided tape will help hold your rug in place. Purchase tape specially made for using with rugs; it will be padded and have light adhesive on both sides. Flip your rug over and adhere strips of the tape along the edges and corners of your rug. Add a few strips toward the center to be sure it adheres evenly to the floor. Carefully lay the rug on the floor right-side up and smooth down to avoid bubbles.
If you continue to have problems, despite these suggestions, consider the placement of the rug. Perhaps the area is too high-traffic to keep the rug in place. Slippy rugs can pose a hazard, especially for children who are running across the rug. If you have hardwood floors, consider an inlaid rug for these areas or try using a larger rug as its weight will help keep it from sliding as much as a small rug or runner. Other options include rug adhesive spray for carpets and adding a rubber backing to rugs on tile and wood floors.