Kitchen drains usually block because cooking oil and grease harden inside the pipe. Bathroom drains block with hair and soap residue.
To prevent it: never pour oil down the sink, use a strainer over drains, and run hot water after washing up.
If a drain blocks again within weeks of being cleared, the pipe may have a dip or damage that needs a plumber to inspect.