Is it possible to create a custom pattern and save it in the pattern library? If so, how?

Thank you.