Шаг 1:
// Create an Intent for the activity you want to start
Intent intent = new Intent(this, MainActivity.class);
Шаг 2:
// Create the PendingIntent
PendingIntent pendingIntent = PendingIntent.getActivity(this, Calendar.getInstance().get(Calendar.MILLISECOND), intent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
Шаг 3:
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID);
builder.setContentIntent(pendingIntent);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
notificationManager.notify(NOTIFICATION_ID, builder.build());
Всякий раз, когда пользователь нажимает на уведомление MainActivity будет открыт
Вот подробности реализации Android Образец уведомления https://github.com/android/user-interface-samples/tree/master/Notifications