If you’re coming from neighboring countries the easiest way to get to Riga is by bus. Lux Express offers routes from Tallinn and Ecolines offers a wider variety of routes. You also have a more expensive and longer but more interesting option of taking the sightseeing tour bus on your way from both Tallinn and Vilnius. Stop off in some lesser visited towns and see a side that many visitors skip over.
Trains are available but not recommended as usually there are not direct routes and long stopovers.
If you’re flying in from somewhere farther away you can take a bus or a taxi into the city. The airport is located 13 km outside of Riga and will take about 30 minutes on the #22 bus (buy ticket onboard, at the airport, from the a machine at the stop or at newstands) and costs less than €2. Airport transfers are around 15 minutes and costs a minimum of €23.