Click and drag your green screen footage into the timeline.
Click on the Effects icon on the right side of the Timeline.
Click on Keying on the Effects Browser sidebar on the left.
Select the Keyer Effect, drag it to the Timeline and drop it on the green screen clip. The green will disappear and a black background will show.
REPLACING BACKGROUND
Click on the Text Icon on the top left side of the FCP display.
Click Generators.
Find a background you would like to use. Drag the selected background into the timeline underneath the green screen footage.
Using the Inspector Window on the left side of the FCPX Display, you can change the color of the background. You can also place images and video in as a background as well.