Heat the oil in a frypan over medium heat. Cook and stir the onion and garlic in the hot oil until the garlic is lightly browned and the onion is glossy, 7 to 10 minutes. Add the fish; season with salt and pepper. Cover and cook for 2 minutes. Add the coconut milk and stir; cover again and cook until the coconut milk appears oily, about 10 minutes.