I think it depends on what your target of segmentation but in general you should prepare your data set as an annotation image or creating a ground truth image. I found this link very useful to start medical image segmentation using U-net
this video will show you to use U-net.
https://www.youtube.com/watch?v=azM57JuQpQI&t=91s
I hope this helps you start the brain image segmentation.