Pls check JobScheduler for apis above 26
WakeLock was the best option for this but it is deprecated in api level 26
Pls check this link if you consider api levels above 26
https://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html#startWakefulService(android.content.Context,%20android.content.Intent)
It says
As of Android O, background check restrictions make this class no longer generally useful. (It is generally not safe to start a service from the receipt of a broadcast, because you don't have any guarantees that your app is in the foreground at this point and thus allowed to do so.) Instead, developers should use android.app.job.JobScheduler to schedule a job, and this does not require that the app hold a wake lock while doing so (the system will take care of holding a wake lock for the job).
so as it says cosider JobScheduler
https://developer.android.com/reference/android/app/job/JobScheduler
if it is to do something than to start and to keep it you can receive the broadcast ACTION_BOOT_COMPLETED
If it isn't about foreground pls check if an Accessibility service could do
another option is to start an activity from broadcast receiver and finish it after starting the service within onCreate() , since newer android versions doesnot allows starting services from receivers