There are a few ways to return different status codes in an ASP.Net MVC Core controller.

Simplified Helper Methods

Some helper methods for the most common codes (there may be more than the list below):

return Ok();           // Status Code 200
return Created();      // Status Code 201 (this one requires parameters)
return NoContent();    // Status Code 204
return BadRequest();   // Status Code 400
return Unauthorized(); // Status Code 401
return Forbid();       // Status Code 403
return NotFound();     // Status Code 404

Some of the helper methods above have overrides that allow you to include an optional response (test/json/html):

return Ok(someJson);
return NotFound("we looked but it's GONE");

Return StatusCode()

Basic return of a status code and an optional response, which can be text, json, html, etc:

return StatusCode(403)
return StatusCode(403, "some text, json, etc.");

Use StatusCodes Enum Instead of Integer

It can be really helpful to make use of the StatusCodes enum (requires using Microsoft.AspNetCore.Http;), which provides some built-in meaning to the otherwise-forgettable status code integer values. A developer who looks at your code in the future (including yourself) will be grateful to see something like StatusCodes.Status424FailedDependency instead of just 424.

return StatusCode(StatusCodes.Status403Forbidden)
return StatusCode(StatusCodes.Status403Forbidden, "some text, json, etc."); // 

Visual Studio autocompletes the enum, making it easy for you to peruse the list of HTTP responses without having to look up which codes mean what. (Although you may still have to read up on the proper way to use them.)