if you're going afk, or even logging off, make sure you go into your coffin. nothing short of a castle raid is going to get you in there. if you aren't in your coffin, a random nothing wolf can kill you even while logged off because you're body persists and can be interacted with. if you're still building your castle and haven't quite cleared the area yet, random animals or poachers or whatever can spawn in or and kill you. later on when you get servants, make sure you build the doors that they can't open, because they wander ALL OVER your property and if a wolf or bear or whatever is sitting right outside your door, as soon as your servant opens the door up they'll just run in and kill you while you thought you were actually safe.
tl:dr, you're a vampire, hang out in your coffin.