With three weeks, you have a lot of options. Both coast are great beaches, though the caribe is a more rustic and low key compared to some areas on the Pacific, and its also cheaper for lodging/
The key parks in the country, are for nature/wildlife and Bio Diversity.
Corcovado is the best park, its also more remote, and you can access 3 different ways depending on what you want to make of it. The main draw for many is the 3 days hike in the jungle, and sleeping at ranger stations, this you need to base in Pt Jimenez, and have a permit/guide/reservations, be ready to hike 21KM on day one and 18KM on send stage.
The other popular way is to access the park via boats, from Drake Bay, and have lodges of everything for you, as a day trip or as a overnight at the ranger station. Best way to get to DB is via boat from Sierrpe, which is down the river and then down the coast...
Last option if to hike the park from the south entrance at La Leona, and base in Carata, 2 hours south of Pt Jimenez.
Allow 4-5 days in the region regardless of which option you choose, its the real deal, and jungle.
The other area that offers a lot of wildlife and nature is Tortuguero Canals and Rainforest, this is accessed via boat from La Pavona, on the caribe side with a 2 bus or shuttle trip from San Jose.
You then have Cahuita NP, a great place to hike and snorkel, and also a funky jive afro caribe town that is known for its spicy food and music scene.
South of there you have Pt Viejo, a more vibrant nightlife and great beaches all the way south to Manzanillo-Ganduca Marine Refuge. Rent bike on this coast and chill out.
Raft the Rio Pacuare between playa Cahuita or Pt Viejo, back to San Jose, and get dropped in SJ, or vice versa, this is one the best adventures in the country, and its a Top 10 River in the Americas to raft, and its also a gorgeous area through a valley with waterfalls, jungle and indigenous indians...
The other area most explore is the mountains in the central valley area, and this is best via a rental car, and would include Arenal NP, Tenerio NP, Cano Negro NP and Rincon NP, and the hard to reach a taro overrated and touristy Monteverde NP.
Pacific beach towns tend to share their existence with the fact they have a great surf. The top places that people prefer are Tamarindo, the surf mecca, and then Nosora/Samara area, and then the hard to reach Mal Pais/Santa Teresa area.
get the MOON guidebook for CR and read about what areas and adventure interest you most. Divide the country into 3 sections, and attack accordingly.
You can fly to Osa/Southern Zone Pt Jimenez or Drake Bay, as well as Tortuguero and Tamarindo. You can also use shuttles, public bus or rent a car.