How to embed nut or hex head bolt in an object?

Hello, I want to embed the head of a hex had bolt to a block so that after I have inserted the bolt into the block, the surface is flat rather than having the head of the blot showing up outside the block. What is the best way to do it?

SolidworksModeling And Assemblies