You can find an example here: https://ggullentops.blogspot.com/2017/10/sitecore-9-forms-custom-submit-action.html
E.g. to get the value from a field called "Email":
var postedFormData = formSubmitContext.PostedFormData;
var field = postedFormData.Fields.FirstOrDefault(f => f.Name.Equals("Email"));
if (field != null)
{
var property = field.GetType().GetProperty("Value");
var postedEmail = property.GetValue(field);
email= postedEmail.ToStringOrEmpty();
}
Not sure if this is still the best way to do it, but that used to work.
Seen some more recent code, and apparently what is done now is:
var email = GetValue(formSubmitContext.Fields.FirstOrDefault(f => f.Name.Equals("Email"));
GetValue function:
private string GetValue(object field)
{
return field?.GetType().GetProperty("Value")?.GetValue(field, null)?.ToString() ?? string.Empty;
}