Basements are underground floors that can be built underneath some buildings in The Sims 2 and The Sims 3. Basements were originally created using the foundation tool, and were sometimes difficult to create until a patch was released for The Sims 3, which added the Basement tool into the Build Mode; this tool was also included in The Sims 3: World Adventures, and can be used to create tombs.
Basements are not possible in The Sims as foundations are not available in the game. Basements in The Sims 2 and un-patched versions of The Sims 3 base game are created by placing an area of foundation that is hollow in the center, then lowering the terrain inside the hollowed-out foundation so that the area in the basement is the equal height of a typical floor, thus making the basement a fully usable space accessible by Sims (assuming that the Sims have a means to reach the basement, such as by stairs or elevator). Pre-existing buildings that do not rest on a foundation can not have basements added to them, though basements can be added to pre-existing buildings that do rest on foundations.
The basement tool from The Sims 3 can be used under foundations, but two sets of stairs will be required to reach the basement area, as a foundation cannot connect directly to the basement floor. Basements can be as deep as 4 stories.