The bearing, hub and knuckle would come off together. Just unbolt the brakes, remove the rotor. Then undo the bolts that join the strut and knuckle. Pop loose the lower ball joint and tie rod and that should be about it.
I wouldnt put a used knuckle on your car. Its nearly impossible tell the condition if its coming from a junkyard. Probably has a bad bearing. The Knuckle could be bent resulting in a car that you have trouble aligning later. Now you are out time and more money.
Just get a new bearing.You may need a new hub. Depends on how bad yours is.If the bearing has been bad for a while you hub is probably worn past its service limits This obviously is not the cheapest way. Bearing is $40-50 and if you need one the hub is $75-90.
If the hub is okay, but the inner race comes out of the bearing and is stuck, you have a few ways to get it off. You can be very careful and cut it off with a die grinder. I've ruined a hub this way.... Other way is heat. An acetylene torch and a prybar.This is how I did my last one. Lastly a bearing puller might get it.