I would start with the specs on your frame. Does it come with "extras" like a headset or bottom bracket?
26"? 29"? Quick Release? Thru Axle? Sizes, dropout spacing?
Quill stem? Threadless stem/headset?
Seatpost size?
Bottom bracket specs?
Disc Brakes? Hydraulic?
Then once you have the specs of your bike down, it can drive your search.
Technically you could swap rims or hubs if one is close and not another, but it can be a hassle, and perhaps expensive. Or choose a donor bike that supplies 75% of the parts, then you'll acquire the remaining 25% of the parts.