Not in the mood for sex

My boyfriend and I have been together for 2 and a half years and we’re sexually active but when we’re having sex I can never enjoy it because it is too painful. Also, I haven’t been in the mood lately. Is something wrong with me or? I don’t take any medication or anything