Can a person earn salvation by working for it?

No; if salvation were by works it would be a debt God owed, but God will never be in debt to a mortal, so salvation is a free gift received by faith.

Watch the Teaching: What Does It Mean to Make Shipwreck of Your Faith?