You need to realize that God is a Spirit, not human like us so you cannot think of this in human terms. However, we have spirits because we were created in God’s image. God the Father, the Son, and the Holy Spirit are three in one. They are not separate, but have separate work to do within the same framework.
It’s like ourselves: we are body, mind and spirit. They have separate functions yet all work together as one.
Hope this helps.