Open an image which is the basics of your pattern
Use the Rectangle Marquee tool to select the area of the pattern (feather must be 0 px).
Then go to Edit > Define pattern and give it a name. I named it Wall texture
To check if its in Photoshop got to Layer > New Fill layer > Pattern
Click ok ... and you can see the pattern is there.