Fear of expressing a boundary

I noticed today that sometimes I just don’t want to be hugged or touched by someone, and that’s okay. I realized this when one of my roomates came to me and asked for a hug and was already arms open leaning in. I don’t think there’s anything wrong with his request. I just didn’t want a hug in that moment. I didn’t voice that though, and hugged him and now I feel kind of like I chose to sacrifice myself for him out of fear he would feel rejected or abandoned if I said no in that instance. I don’t want him to take it personally.

Yet ironically enough, now I am abandoning him because I feel resentment. I don’t really want to be around him because I’m afraid to own that I don’t always want to be hugged. I’m afraid to reject someone.

This isn’t serving me because I end up actually creating a rift between me and him which was my intention when I thought “I don’t want him to feel rejected if I say no.”

How can I get over my fear of expressing a boundary and be okay with the other person making it mean whatever they want?