How they treat you has nothing to do with how they actually feel about you. How they treat you is a reflection of how they feel about themselves.
If they are confusing, they are confused. If they are emotionally unavailable, it’s probably because they are. If their actions don’t align with their words, it’s because they probably don’t know what they want. If they don’t respect your boundaries, they probably don’t have any themselves. If they treat you like shit it is because internally they feel like shit (no matter how much they deny it). They have not figured it out.
We often all seem like we are okay on the outside when internally something can really be going on. It takes a lot of work to learn who you are and what you want — especially in an age where everyone wants to tell you what you should want and who you should be.
The way you are being treated is a direct reflection of their own struggle. Don’t internalize it.