All of what Paul writes here flows from the text he has already written - hence the 'therefore' starting this chapter. If we are in this together, living our lives on the line, not ashamed, courageously for Christ, then the stuff here in chapter can apply.
Notice the sense of unity, the strong connection between Paul in Rome and the Philippians over 4,000 miles away. They both lived for Christ by the same Spirit - they were united in what they wanted. Note also Paul starts with being and then moves onto doing: 'If we share together, then bring me joy by being like-minded ...'. Only after 4 'being' points does he move onto 'doing'. God calls us first to be: in Genesis 1 God created us and then blessed us simply because of our being. Then he said 'be fruitful' (again being, but implying action), and only then the 'doing' instructions come. For us to be in Christ is first and foremost about being - the action then flows from this.
Then note that the actions Paul describes are firstly negatives: 'Do things not out of selfish ambition ...'. He calls for those to be cleared away so that we can act differently, in Christ's way. In His way we know our worth set in Christ, and can know that in relation to others (those we relate to, work with etc.). So Paul calls us to relate in a way that is different to the world, not needing to always compare ourselves or self-assert ourselves above others. This starts with our mindset, calling for us to have the same mindset as Jesus.
To describe this mindset he quotes a poem - perhaps the first ever Christian chorus. The content can be summed up as Jesus led a 'given life', for it describes how though Jesus had equality with God he didn't consider this something to be grasped but instead gave it up. Note the contrast with humanity: in Genesis 3 the humans see the possibility of being like God themselves and so reach for the apple, grasping for equality whereas Jesus had it in the first place and yet gave it up. In short Jesus reduced himself, lowering down to be human - someone with humble position, a 'zero' in today's terminology. He lived fully human, including right through death. And not just any death, but the worst execution the Romans could devise.
Paul continues in verse 12 onwards with some practical implications for our everyday life. We too have to work it out, making the fundamental choice to adopt this same mindset of Jesus:
Key Qn: [IN] What does it mean for you to have the same mindset as Christ Jesus?
Challenge: Choose a way that affirms others
In verse 14 Paul says do it without grumbling or complaining. Its easy for us to grumble or moan about others - but let us instead acknowledge clear failings where they exist and yet still highlight something in the other person which we can affirm.
A note of caution regarding this call to live a 'given life'. Some Christians do understand this and do their best to give of themselves in many good ways. Yet in doing so they drain themselves to their last drop of energy, and then turn that last drop into feely guilty about not doing enough. I do not believe this is the correct way to live!
Yet I also do not believe it is about setting some kind of quota either (portioning some to give, some to hold back for yourself). No - the correct way through is being in Christ and choosing his same mindset, which will enable you to give of yourself out of God's gracious resources. I.e. God gives you grace to lay your life down.
In choosing the mindset of Jesus you have to clear out those negatives (mentioned earlier). They act like 'fat-bergs' in the pipes, blocking the way for God's grace through us. So clear out the selfish ambition, the desire for status, the lack of choosing to see good in others: get rid of these in the same self-emptying mindset of Jesus, so that the grace of Jesus can flow through and energise your life.
Paul was about real people in real circumstances - we see that in verse 19 onwards. This is not just an abstract theory. Worked out in practice it enables us to take actions of eternal significance ('shine like stars' - verse 15). It makes our life an offering.
Paul knew his life might be terminated, and uses Old Testament ritual offering imagery here. Religious practice would offer a bull/goat/lamb, and some wine would be poured over as a 'drink offering'. Paul calls us to work out our lives with the same mindset of Jesus, making our lived lives an offering. If Paul's life is then executed, it will be like the measure of wine poured out on top.