Anakin Skywalker is a slave before he becomes a Jedi apprentice. He lives with his mother, Shmi Skywalker, on Tatooine, where they are owned by the junk dealer Watto.
In Star Wars: Episode I – The Phantom Menace, Jedi Master Qui-Gon Jinn meets nine-year-old Anakin while searching Watto’s shop for parts. Anakin is also an exceptionally skilled mechanic and podracer, but those abilities do not change his legal status as a slave. Qui-Gon wagers on Anakin winning the Boonta Eve Classic podrace and secures the boy’s freedom as part of the bet.
After Qui-Gon discovers Anakin’s extraordinary connection to the Force, he brings him before the Jedi Council. The Council initially refuses to train him because he is considered too old and consumed by fear of losing his mother. Following Qui-Gon’s death, Obi-Wan Kenobi takes Anakin as his Padawan, making him a Jedi apprentice.
A common mix-up is calling Anakin a podracer or mechanic as the answer. Those are important parts of his background, but “a slave” is the single canonical answer to what he was before entering Jedi training.