You need to buy a KVM which stands for keyboard, video and mouse. It allows you to command two computers with one keyboard and mouse and use a single monitor as well. You usually swap between the two with a couple of keystrokes. You shouldn't expect to pay more than £10 or $15 on e-Bay.