In Acts chapter 9, Ananias receives a vision and the record states what he heard: "The Lord called to him in a vision..." Ananias replies that this Saul "has done great harm to your saints in Jerusalem, and he has come here with authority from the chief priests to arrest all who call on your name."
The book of Acts tells us just whose name the saints in Jerusalem called on - it was the name of Jesus. Look at Acts 2:38 and compare it with verse 21 where the prophecy in Joel 2 is recited. The fulfillment of that prophecy is to call upon the name of Jesus to be saved, for "Jesus is Lord" (1 Corinthians 12:3). Interestingly, Acts 2:30 goes on to add that "The promise is for you and your children, and for all who are far off - for all whom the Lord our God will call." And 1 Corinthians 1:2-3 states that all Christians "call on the name of our Lord Jesus Christ - their Lord and ours: Grace and peace to you from God our Father and the Lord Jesus Christ."
Ananias identified the resurrected Christ as the Lord, whose servants Saul was out to persecute. When Saul sees the glorious Lord, who asks why Saul is persecuting him, Saul asks, "Who are you, Lord?" The answer is direct: "I am Jesus, whom you are persecuting." Saul and Ananias were in no doubt that, in their respective visions, it was the risen Lord Jesus Christ speaking to them. The context given in chapter 9 makes it clear. That's how we know. Study the context.
In the New Testament, you soon spot how the Father, the Son and the Holy Spirit work in utter unity, co-ordinating all that they do, even though they have their distinctive roles in the Godhead. A good example of that is Ephesians 3:14-17, where the three are inter-twined in a doxology. Then a few verses on (4:3-6) it's the same again. There is one Spirit, one Lord (Jesus) and one God the Father. Again, this is stressed in 1 Corinthians 8:5-6:
"Yet for us there is but one God, the Father, from whom all things
came and for whom we live; and there is but one Lord, Jesus Christ,
through whom all things came and through whom we live."
A few verses earlier the Father, the Son and the Spirit are linked (6:11). It's the same in the last book of the Bible, where God gives the risen Christ a revelation which Christ instructs an angel to give to the apostle John, and throughout, the Holy Spirit takes John into visions of the Revelation (1:1-2 & 10 plus 4:1-2 & 5:6). All three are bound up in the Revelation. Although the Holy Spirit draws all attention to Christ, here's a couple of occasions when he speaks: 1 Timothy 4:1 & Hebrews 3:7. Also, to lie to the Holy Spirit is to lie to God (Acts 5:4 & 9 but note that this is a different Ananias to the one in chapter 9!)
Study the context of any verse speaking of 'Lord' to establish if it is the Lord God, or the Lord Jesus, or the Holy Spirit (who is also Lord - 2 Corinthians 3:17). This is not confusing when you grasp the unity of the Godhead - the one Being of God subsisting in the three co-equal, uncreated Father, Son, and Holy Spirit. When the Bible speaks of all three, Almighty God is used. But context establishes whether the word 'Lord' specifically identifies Christ, or the Holy Spirit, or the Father. This is an immensely deep and important doctrine. If you are new to the Christian faith you will need time to search the scriptures and you will need to learn how to seek the Spirit's guidance.