Either only brakes or both. The reason is not really a technical one but rather a safety one: due to the different engine size/power to weight ratio, the engine brake slows you down much quicker that in a car. Combine that with a very small profile from behind and you are basically a huge surprise for the person behind you when you slow down that quickly without the brake light as an indicator; perfect recipe for disaster.
Always use your brakes when slowing down. Good practice is to slightly press the rear brake (foot) when you decelerate so the light goes on, but for now just always use the brake for everything.
Also, especially as a new rider, keep proper distance to the car in front of you. Stay safe and have fun!