Been through this twice. Once from the receiving end, once where I saw it coming early enough to act. Here's what I wish I'd known the first time.
The early signs most people miss:
You stop getting included in meetings you used to attend. Not explicitly excluded, just... not invited. When you ask, it's "oh it wasn't relevant for you."
Your manager's feedback becomes vague and then non-existent. No more "here's what I need to see from you." Just "keep doing what you're doing" delivered flatly.
Projects shift away from you during planning. The good ones, the visible ones. You get cleanup and maintenance.
Your manager starts being very formal in writing. Things that used to be verbal or Slack are suddenly in email with your name on it.
CC'd on nothing, but also CC'd on everything suddenly, including threads where you'd normally be a lead.
What you can still do when you see this:
Ask directly. "I've noticed some changes in how we're working together. Can you tell me honestly where I stand?" A lot of managers will give you an actual answer if asked plainly.
Get a clear improvement plan if one exists. If they want you to improve something, make them say what and by when. Vagueness protects them, not you.
Start looking immediately. Not because you've failed, but because the dynamic rarely reverses. You want to leave on your terms if you're leaving.
Connect with your skip-level. Not to escalate, just to have visibility beyond your direct manager. It's good insurance and gives you more data.
The one thing I regret from the first time: I waited too long hoping things would turn around. They didn't. The second time I saw the signs, I had an offer before anything formal happened.