There are five paths to a commission as a Marine.
1. Attend USNA
2. Enroll in NROTC, with or without a scholarship. There are opportunities to earn a scholarship along the way. If you do not earn a scholarship you can earn advanced standing by your Junior year, which gets yo the stipend and allows you to commission.
3. Enroll in the Platoon Leaders Class (PLC) and train over two consecutive summers. You get paid for the 6 weeks you're there every summer but uniform costs come out of that.
4. Attend Officer Candidate Class (OCS) after graduation from college. You must apply and be selected. You would commission immediately after successful completion and go on to TBS and active duty immediately
5. Enlist and hope to impress your command with your leadership ability, so that they endorse your application to become an officer. If selected you attend OCS right away, then college along with an NROTC unit, and then commission. I think you need to complete college in an accelerated time frame (3 years?), but you are on full pay while doing that. I believe you would be expected to previously complete some online college education. As you might imagine, there is some elapsed time as enlisted personnel to demonstrate your leadership abillities. See here:
https://officercandidatesschool.com/2017/06/18/whats-marine-mustang-officer/
The surest paths to a commission are 1, 2, and 3. Of course 1,2, and some similar 4, apply to the Navy as well. You can find out about all of these online via google or US Marine or US Navy web sites.