Could I use the present perfect progressive as in "I've been trying to power up the laptop earlier. But I could not do it since I don't know the code."?
No, you can't use it with the adverb "earlier". You have obviously stopped trying to power up the laptop, so the present progressive is not right.
You could say: "I've been trying to power up the laptop all day. But I haven't been able to do it since I don't know the code." (This means that you're still trying)
Otherwise, you must say, "I was trying to power up the laptop earlier ..."
When you say "I have been trying", this tells the reader that this took place in the past.(earlier)
You then want to say what is happening now, as a result of the past, so the additional information can be stated in the present.
I have been trying to call you all day but I can't seem to connect with you.