The Missouri Compromise (1820) established the 36'30 line as the latitude/longitude where slavery would stop. In this law, any territory above the 36'30 line would not allow slavery. Any territory below this line would allow for slavery. However, as the US kept adding territories this line no longer worked.
Instead, in the Compromise of 1850, Congress voted to let California enter as a free state and they'd let other western territories (like New Mexico and Utah) use the idea of popular sovereignty. Popular sovereignty allows for the people of the territory to vote on whether or not there would be slavery.