Unfortunately "brain" coral is too generic. That term is use for a broad range of corals like, Trachyphyllia sp, Favites sp, and Lobophyllia sp. I'm sure there are others. So without knowing what you have it is hard to say, but generally if it is unattached it is simply a matter of carefully moving it. I'd do it when the polyps are contracted to minimize the risk of injury.
The pic is a little blury but it looks like a Trachyphyllia sp. It has a hard unattached bottom right? If so, when the polyps are contracted, usually they are all day, gently scoop it up trying not to touch the flesh, but only the hard base, and move it slowly through the water to it's new position. Trachyphyllia sp, do just fine in the sand. One hint, if the flesh is hanging over the edge covering access to the hard bottom, you can very gently touch the edge of the flesh, as you are not food it will normally contract a bit exposing the bottom and getting the flesh out of harms way.