These are good answers, but I would also suggest checking the NUnit documentation, since the setup might change over time: https://docs.nunit.org/articles/nunit/technical-notes/usage/Trace-and-Debug-Output.html
Today, when I was looking at the same problem in VS 2022, I got it working by
a) Adding the code in the 2nd example from the page page referenced:
[OneTimeSetUp]
public void StartTest()
{
if (!Trace.Listeners.OfType<ProgressTraceListener>().Any())
Trace.Listeners.Add(new ProgressTraceListener());
}
b) Change the output in from "Debug" to "Tests" in Visual Studio:
c) Then I was able to see the Console.WriteLine("Whatever!")
output that's inside my test.