The Xbox will have an HDMI port. You can use that to connect to the monitor using an HDMI cable. The PC will generally have HDMI and DVI and DP depending on the motherboard/graphics card. If you want to connect them simultaneously, you could use the HDMI for Xbox and DVI/DP on the PC and switch the inputs manually as and when needed.
Do provide the exact version of Xbox (360 or One or One S or One X) and the motherboard/graphics card. That would help in giving you an exact answer based on the product you own.