couldn't ssh in BeagleBone.

I have tried many times to ssh into it. Neither it works in port 22 nor port 2222. I have tried to reset my BeagleBone, but it flashed for a very long time and can’t stop. I am using a Mac. What should I need to do?