Sometimes you may need to check the status of windows service, you can do it with following simple way.
Creating a new Windows Forms Application, then design a simple UI as shown below. You can also use console application to run the code below.

Right-clicking on your Reference, then add System.ServiceProcess to your project.
Adding a click event handler to the check button allows you to check the windows service status.
private void btnCheck_Click(object sender, EventArgs e)
{
var service = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == txtServiceName.Text);
if (service == null)
lblStatus.Text = $"Service {txtServiceName.Text} not found!";
else
lblStatus.Text = $"Service {txtServiceName.Text} is {service.Status}";
}
and don't forget to add
using System.ServiceProcess;
to your form.