This extended quote may be the most helpful and succinct commentary written on Philippians 2:12-13 in the English language. It is worth your time to read it slowly and thoughtfully.
While we are constantly dependent upon the supernatural agency of the Holy Spirit, we must also take account of the fact that sanctification is a process that draws within its scope the conscious life of the believer. The sanctified are not passive or quiescent in this process. Nothing shows this more clearly than the exhortation of the apostle: “Work out your own salvation with fear and trembling; for it is God who works in you both to will and to do for his good pleasure” (Phil. 2:12-13). The salvation referred to here is not the salvation already in possession but the eschatological salvation (cf. 1 Thess. 5:8-9; 1 Pet. 1:5, 9; 2:2). And no text sets forth more succinctly and clearly the relation of God’s working to our working. God’s working in us is not suspended because we work, nor our working suspended because God works. Neither is the relation strictly one of co-operation as if God did his part and we did ours so that the conjunction or co-ordination of both produced the required result. God works in us and we also work. But the relation is that because God works we work. All working out of salvation on our part is the effect of God’s working in us, not the willing to the exclusion of the doing and not the doing to the exclusion of the willing, but both the willing and the doing. And this working of God is directed to the end of enabling us to will and to do that which is well pleasing to him. We have here not only the explanation of all acceptable activity on our part but we have also the incentive to our willing and working. What the apostle is urging is the necessity of working out our own salvation, and the encouragement he supplies is the assurance that it is God himself who works in us. The more persistently active we are in working, the more persuaded we may be that all the energizing grace and power is of God.
The exhortations to action with which the Scripture is pervaded are all to the effect of reminding us that our whole being is intensely active in that process which has as its goal the predestinating purpose of God that we should be conformed to the image of his Son (Rom. 8:29). Paul says again to the Philippians, “And this I pray that your love may abound yet more and more in knowledge and in all discernment, so that ye may approve the things that are excellent, that ye may be sincere and without offence unto the day of Christ, being filled with the fruit of righteousness which is through Jesus Christ, unto the glory and praise of God” (Phil. 1:9-11). And Peter, in like manner, “Yea, and for this very cause adding on your part all diligence, in your faith supply virtue; and in your virtue knowledge; and in your knowledge self-control, and in your self-control patience; and in your patience godliness; and in your godliness brotherly kindness; and in your brotherly kindness love. For if these things are yours and abound, they make you to be not idle nor unfruitful unto the knowledge of our Lord Jesus Christ” (2 Pet. 1:5-8). It is unnecessary to multiply quotations. The New Testament is strewn with this emphasis (cf. Rom 12:1-3, 9-21; 13:7-14; 2 Cor. 7:1; Gal. 5:13-16,25,26; Eph. 4:17-32; Phil. 3:10-17; 4:4-9; Col. 3:1-25; 1 Thess. 5:8-22; Heb. 12:14-16; 13:1-9; James 1:19-27; 2:14-26; 3:13-18; 1 Pet. 1:13-25; 2:11-13, 17; 2 Pet 3:14-18, 1 John 2:3-11; 3:17-24). Sanctification involves the concentration of thought, of interest, of heart, mind, will and purpose upon the prize of the high calling of God in Christ Jesus and the engagement of our whole being with those means which God has instituted for the attainment of that destination. Sanctification is the sanctification of persons, and persons are not machines; it is the sanctification of persons renewed after the image of God in knowledge, righteousness, and holiness. The prospect it offers is to know even as we are known and to be holy as God is holy. Every one who has this hope in God purifies himself even as he is pure (1 John 3:3).
John Murray (Redemption Accomplished and Applied, Eerdmans, pp 148-150)