One of the techniques that can be very helpful is when you lie down in bed, don't put on your sheet, don't put on the blanket. Do the Compassion/Lovingkindness meditation and when you are finished, then put on the sheet or blanket. If you develop this as a habit, it actually helps you to stay awake better for doing the meditation, because you know you don't have your sheet on yet and that it is not time to go asleep yet. This is one technique that can help you to stay awake longer and be able to do the Compassion/Lovingkindness meditation before you go to sleep.