The best defense against sand and dirt in general on flooring is the vacuum.
The Carpet and Rug Institute (CRI) recommends vacuuming areas often that receive the most traffic, such as hallways, stairs, and exterior entryways in the home. Ideally, vacuum all the floor coverings a minimum of once a week, and the high-traffic areas more often, based on the usage.
If you have pets, you may need to vacuum some areas daily. Removing loose soil while it remains on the flooring surface is important so that it is not walked into the carpet pile or wood finish.