It's very simple and easy to avoid being a vampire.
To become a vampire you need to have gotten the Porphyric Hemophilia disease (it will show up on your spell effects tab and will slightly decrease "fatigue"). If after a few days with that disease you sleep, then you will become a vampire (if you haven't already been cured).
So all you need to do is cure the disease before sleeping. You can do that through any standard cure disease method like: eat a Mandrake root, drink a cure disease potion, cast a cure disease spell, use a church, etc.
Once cured you can sleep.
By the way that message you get when you sleep is not a Vampire attacking you. It is a nightmare. That's why you get it in any bed. So if you don't want it and vampirism, then just cure the disease before sleeping.