How can I get rid of these edges?

In the image where the castle is in front of my background the castle has a weird edge around it. I’m not sure how to get rid of them.

Can anyone help?

FIXED: I clicked “Full Sample” under anti aliasing and it got rid of the edges