If you have Luma installed, you can do this:
Power your 3DS off. Hold Select while powering on and the Luma configuration shows up. Go to the PIN lock option and set it to how many digits you want the passcode to be. You can set it to 4 or 6 or 8. (Highlight the option and press A to toggle.) Then press Start and enter the code you want to have. You can use the A B X Y Up Down Left and Right buttons.
You will then have to enter that code every time you boot Luma. To change or remove the code, just enter the configuration again and change it from there.
If you forget the code... well, you can just delete Luma's settings. Which means that the passcode is resettable if your brother can take your SD card out and plug it into a computer.
A more secure method does exist, but if you use that and forget the passcode, the system is effectively bricked, as there is no way to reset it.