The simple answer is there is no safe way that is 100% guaranteed not to break off a stud.
Sometimes they break and you have to drill them out.
With all that being said, there are some ways to remove the studs that will greatly increase your chances of removing the studs without having them break off.
One of your best friends is as shown below:

That's right, HEAT IS YOUR BEST FRIEND.
Many studs are held in with thread locker.
Unless you heat them first you will have a real hard time getting them loose.
Some studs are just plain stuck due to corrosion.
Your next best friend is shown below:

Get some good penetrating oil (We use Kroil) and let those studs soak over night.
We further suggest that you apply the penetrating oil several times during the day and then let it sit over night.
Sometimes it takes a combination of heat and penetrating oil to help them come out easier.








