How to cut custom shape in mesh?

I saw this: