Every networked device connected to your router has a MAC address, which is specifically linked to one device, unlike local IP addresses in your private network, which are assigned by your router and don't have to be permanent.
Generally, local IPs are assigned sequentially, often starting at
192.168.0.2 and so on, as described by How-To Geek:
Newer routers often have the ability to remember which IP address was assigned to which computer, so if they disconnect and reconnect their IP doesn’t change. Often, though, a router reset will wipe this cache and start assigning IPs on a first-come, first-served basis. Tons of older routers don’t even have this ability, and immediately assign new IP addresses.
That's obviously not great if you want a static local IP for Home Assistant to use. If your router doesn't remember which IP was assigned to each device, you can usually configure this using a DHCP reservation option, which will usually consist of adding the MAC address and desired static IP to a list for your router to use when assigning IPs.
You're probably wondering, though - how can I get the MAC address of my devices anyway? Your router almost certainly has a list of devices connected, their local IPs and MAC addresses, as shown in this answer (although the exact method of viewing this again depends on your router).
I'll update this with device-specific instructions when you include the router model in your answer, but I think these general steps should be enough to help anyone with a similar problem.