The laborers who built the pyramids were, contrary to public opinion, not slaves, and certainly not Hebrew slaves. Instead, working on the pyramids was considered a form of taxation. Peasants would be required to work on the great building projects for a requisite amount of time each year.
There are a number of previous answers in our FAQ section that may be helpful.