There are a few ways to do this.
Using Boolean operations:
- In Edit mode
Both pieces have to be part of the same object.
On the selected piece use Mesh>Faces>Intersect(Boolean)
- In Object Mode
Both pieces have to be different objects.
Select the one that is to be cut. And add a boolean modifier and use the other object to intersect.
This method has the advantage of being non destructive and interactive. If you need to reposition or alter the cutting object you can do it and the affected object will be recalculated.
At this point you can choose to hide other object or Apply the Modifier to make the change permanent and delete the cutting object.