Before we continue please remember that you can only play when you are both connected to the same Wi-Fi network.
Also make sure to remember that you must all be playing on the same version or it will NOT work. I recommend you play using Fabric 1.16.5 or whatever version the launcher says "recommended" on.
Step 1.
Open Minecraft.exe and then click the button that says "Player" or "Profile" or something like that. It should be on the top right of the launcher menu thingy.
Step 2.
Click "Manage Accounts"
Step 3.
Right click the profile and press "REMOVE".
Step 4.
Click "ADD OFFLINE"
Step 5.
Type any name you want and press "OK".
Make sure that you and your friends all have different usernames or else you will get an error upon joining the game.
Step 6.
Right Click Fabric 1.16.5 or whatever the recommended version is for you.
Hover over the "Launch" option to open up the menu shown on the right.
After that menu is open for you please select "Launch Offline".
Step 7.
Create a world and once you load in press the "ESC" key to pause your game.
After you do this click "Open to LAN".
Step 7.
Press "START LAN WORLD".
Step 8.
Now you can invite some friends! Make sure your friends are on the same network as you and make sure they all click "MULTIPLAYER" option in the main menu.
Step 9.
Now your friends can join your world by selecting "Join Server".
Step 10.
Enjoy Minecraft with your friends you're all set now!
EXTRA
If you get an error that says this than follow the following steps.
Step 1.
Open Minecraft.exe and then click "Settings".
Step 2.
Click "Java".
Step 3.
Paste this exact command in the JVM arguments and press close. You're done.
-Dminecraft.api.auth.host=https://nope.invalid -Dminecraft.api.account.host=https://nope.invalid -Dminecraft.api.session.host=https://nope.invalid -Dminecraft.api.services.host=https://nope.invalid