You should also seek out a solid-state drive that uses USB 3.0 for the fastest performance - you might want to look up benchmarks of external drives before you buy them. You’ll need a drive that supports USB 3.0 and is at least 256 GB in size, or the Xbox One won’t allow you to install games to it.
Games will load faster from a sufficiently fast external drive than they would from the internal mechanical drive. Buy a speedy external SSD that uses the USB 3.0 specification, plug it into your Xbox One, and you can install games on that drive. However, the Xbox One does support external hard drives you can connect over USB. Microsoft’s Xbox One doesn’t allow you to open it and replace its internal drive. Sony’s guide will walk you through backing up the data currently on your console to a removable drive, accessing the PlayStation 4’s hard drive bay, installing the drive, and then reinstalling the PS4 system software on your new drive and restoring the backup. You can only have one hard drive installed at a time in your PS4, so you might want to purchase a fairly large SSD.