[Samsung Galaxy Tab A series Questions & Answers] retiredtab:
Just remember the link I referenced is a template and that you have to substitute in the parameters that you want to build.

So if you want 18.1, you need to change

repo init -u https://github.com/LineageOS/android.git -b cm-14.1

to

repo init -u https://github.com/LineageOS/android.git -b lineage-18.1

If the SM-T500 isn't a LineageOS officially supported device, it won't show up when you try

breakfast <your device name>

You need to find out what your SM-T500 device name is. You can do that by downloading an free app called devcheck by flar2. It's a wonderful utility that I use regularly to help troubleshoot and verify my work.

https://play.google.com/store/apps/details?id=flar2.devcheck

Once installed, if you goto the system tab, it will tell you the device name just under the product information. For example, the SM-T560NU's device name is gtelwifiue. This is what you need to know and remember.

Once you find your SM-T500 device name, then you need to search xda and github for code repositories and most importantly a manifest or roomservice.xml file. This will tell the build system where to find all the device specific code, proprietary binary blobs and other dependencies that it needs to build the rom.

A sample manifest or roomservice.xml looks like this. This is for device I'm currently building with the 17.1 Dec 5th security patches.

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<!-- Samsung MSM8916 Common Repos -->
<!-- <project path="device/samsung/msm8916-common" name="aala27/android_device_samsung_msm8916-common" remote="github" revision="Q10.0"/> -->
<project path="device/samsung/msm8916-common" name="Galaxy-MSM8916/android_device_samsung_msm8916-common" remote="github" revision="lineage-17.1"/>
<project path="device/samsung/qcom-common" name="LineageOS/android_device_samsung_qcom-common" remote="github" revision="lineage-17.1"/>

<!-- Samsung Hardware Repo -->
<project path="hardware/samsung" name="LineageOS/android_hardware_samsung" remote="github" revision="lineage-17.1"/>

<!-- Common Samsung MSM8916 Kernel -->
<project path="kernel/samsung/msm8916" name="Galaxy-MSM8916/android_kernel_samsung_msm8916" remote="github" revision="lineage-17.1"/>

<!-- Vendor Trees (for all devices) -->
<project path="vendor/samsung/msm8916-common" name="aala27/android_vendor_samsung_msm8916-common" remote="github" revision="Q10.0"/>
<project path="vendor/samsung/gte-common" name="aala27/android_vendor_samsung_gte-common" remote="github" revision="Q10.0"/>
<project path="vendor/samsung/gt5note10wifi" name="aala27/android_vendor_samsung_gt5note10wifi" remote="github" revision="Q10.0"/>

<!-- Qcom audio -->
<remove-project name="LineageOS/android_hardware_qcom_audio"/>
<project path="hardware/qcom-caf/msm8916/audio" name="Galaxy-MSM8916/android_hardware_qcom_audio" remote="github" revision="lineage-17.1-caf-msm8916" />

<!-- Dependencies -->
<project path="external/sony/boringssl-compat" name="LineageOS/android_external_sony_boringssl-compat" remote="github" revision="lineage-17.1"/>

<!-- arm-eabi-7.2 -->
<project path="prebuilts/gcc/linux-x86/arm/arm-eabi-7.2" name="Galaxy-MSM8916/android-prebuilts-gcc-linux-x86-arm-arm-eabi-7.2" remote="github" revision="master"/>

<!-- Galaxy Tab P550 -->
<project path="device/samsung/gte-common" name="aala27/android_device_samsung_gte-common" remote="github" revision="Q10.0"/>
<project path="device/samsung/gt5note10wifi" name="aala27/android_device_samsung_gt5note10wifi" remote="github" revision="Q10.0"/>

</manifest>

The product is SM-P550 and it's device name is gt5note10wifi.

This file needs to go into the .repo/local_manifests directory.

So if you did something like

mkdir code
cd code
repo init -u https://github.com/LineageOS/android.git -b lineage-18.1
# put your roomservice.xml file in .repo/local_manifests
# you may need to create the local_manifests directory if it doesn't exist
# after that then
repo sync
source build/envsetup.sh
# see if all dependencies are met
breakfast <your SM-T500 device name>
# if okay, then build rom
brunch <your SM-T500 device name>

Now if you can't find an existing code repo for the SM-T500, then this exercise becomes 100x harder because you will have to make it yourself from scratch. That's something I haven't had to do myself, but upgrading/maintaining existing repos for each new version of Android is challenging enough.

Finding an existing and working SM-T500 code repo will be the most important thing in your journey in rom building. If you find a non working repo, then you will have to fix it and that will likely take weeks, not days, of researching, learning, troubleshooting etc. There's a reason it's called a custom rom. Each device has it's own custom parameters, quirks, bugs, traps, etc.

For example, for SM-P550, I had to modify the code repo to make it run properly for 17.1. Extensive changes were required to make it work for 18.1 and it will be same when I try to make it work for 19.0.