Romans 8:26, 27
26 Likewise the Spirit also helpeth our infirmities: for we know not what we should pray for as we ought: but the Spirit itself maketh intercession for us with groanings which cannot be uttered.
27 And he that searcheth the hearts knoweth what is the mind of the Spirit, because he maketh intercession for the saints according to the will of God.
Through Jesus Christ we have access to God. Through the Holy Spirit we have agreement with God’s will.
Of course this comes with living a life led by the Spirit of God (v. 14). When we are led by the Spirit and we allow Him to control us, we have assurance that what we do will be in agreement with His will.