Published knitting patterns usually recommend a specific yarn. However, they contain the clues you need to determine if your handspun might work with the pattern.
The place to start is the needle size the pattern calls for. Take your handspun yarn, fold a length of yarn in half so you have two strands side-by-side, and lay it over your knitting needle gauge tool. The hole that doubled length covers completely without being bigger than, is the size needle you'd use for a solid knit fabric, not too cardboard-tight and not too gauzy.
Here I am sizing some handspun Romney cross 2-ply on my needle gauge. The Romney cross 2-ply was 9 wpi, and fit the 6mm/US10 needle nicely.
And here is the sizing of handspun Cormo 2-ply, 15 wpi. Two strands fit the 3.75mm/US 5 hole nicely.
Match your yarn to the pattern's needle size, and then make any adjustments for your knitting -- tight knitters go up a needle size or two, loose knitters go down a needle size or two. Which is to say, for that Cormo, I'd look for a pattern that uses a US 5/3.75 mm, and then, being a tight knitter, pick up my US 6/4 mm to knit with.
If your handspun has some variety in its diameter along its length, look for two representative strands. If you hit a small length while knitting that is just waaay too skinny or too wide, you can "edit them out" by leaving a length on the wrong side of the knitting, to be cut and woven in afterward.
This primarily works if the knitted item is a solid, not over-dense or over-lacy fabric. Lace knitting typically uses a needle several sizes too large (many sizes "too large", actually, as most lace yarns would use 0-0000 size needles knit into a fabric). And some warm winter woolies are purposely knit on needles "too small" for the yarn for a denser, warmer knit fabric.
The second thing you can check is the thickness of the yarn used in the pattern -- if it has a CYCA number, that can put you on the right ballpark. See my CYCA number-to-WPI mapping post. Or if you can get a wraps per inch of that yarn, you can test the wraps per inch on yours and see if it matches (or comes within a wrap either way).
Take a pencil, mark an inch out on it, and wind your yarn around the pencil, not pulled tight just well-organized and touching the pencil, for the inch, so the strands are next to each other, no pencil showing through ... the number of wraps in that inch is, ... the wraps per inch :-)
Another consideration that we don't always consider, is drape. Your handspun may be denser or fluffier than the commercial yarn (yes, it can go either way -- depends on materials, spinning style, fiber prep, and finishing). So, knit a swatch and see if you like the drape you get, and if it's appropriate for the item.
The skeins featured here were spun by me this summer from a lovely dark brown Romney/Polwarth/Cormo fleece from Shepherd's Extravaganza in Puyallup that I had processed locally by (web-less) Taylored Fibers into lovely soft roving; and a tan-grey Cormo fleece from Ortmann's in Montana (they advertise in Spin-Off), processed into heavenly pin-drafted roving by Morro Fleece Works. The knitting needle gauge (isn't it cute!) is solid brass, made by Goose Pond and available at The Bellwether.
How can I match a commercial yarn?
Whose WPI table is right?