The action method should be async and you're missing an await.
[HttpGet("{id}")]
public async Task<IActionResult> GetUserAsync(string id)
{
var user = await userManager.FindByNameAsync(id);
return Ok(user);
}
I recommend learning async/await programming in C#.
Asynchronous programming with async and await
I also recommend not using "var" until you have a better understanding of C# types are being returned. Hover your cursor over "user" and select "Use explicit type instead of 'var'" from the tip. Doing this step will show the actual type returned from the method which will help verify you're working with the expected type.
Keep in mind, you might receive a different error after making the action async since the design returns an entity. The Json serializer will attempt to serialize every relationship. You might have to add the following to the program.cs file.
builder.Services.AddControllers().AddJsonOptions(x =>
x.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles);
A better solution is returning a POCO class otherwise known as a View Model.