You can buy the matching plug at any auto parts store. The trailer usually has the male connector so you need a matching 4 pin female connector. It usually has a cap on it to protect it from the weather.
One wire will be the ground, another will be the brake, and the other two are the left and right turn signals. You will need to remove the rear fender to get to the wires to install it.