Most nationalities can enter South Korea for 30 days or more.
Passport holders from Afghanistan, Bangladesh, Cameroon, Cuba, Egypt, Gambia, Ghana, Iran, Iraq, Kosovo, Kyrgyzstan, Myanmar, Nepal, Nigeria, North Macedonia, Pakistan, Palestine, Senegal, Somalia, Sri Lanka, Sudan, Syria, Uzbekistan and Yemen need to have a visa organised in advance.
Before you depart from South Korea you will need to have a K-ETA organised in advance. The K-ETA costs 10,000KRW (US$9) and is valid for 2 years.
South Korea K-ETA
South Korean Visa Regulations
South Korean Embassies and Consulates