What’s the difference between a primary key and a foreign key?

Need help understanding how to use primary and foreign keys effectively in database design.