How can I move my BoxCollider2D that is attached to my Player in c#.
I don’t really understand what you want to do, as you need to explain more. But i will assume that you want to move only the collider, but not the object. If that is the case, you can simply do it by changing the offset of the collider. Try this:
gameObject.GetComponent<BoxCollider2D>().offset = new Vector2(newX, newY);
Maybe i can help more if you can explain better.
All the best.