They are easy: very similar to a function but they can modify the database but can't be used in SELECT statements.
Start here:
SQL Stored Procedures[
^]
Do note that you should only ever call GETDATE once in a lump of code and save the result for further use: if you call it multiple times the value you get could be very different between successive calls: at the end of a year for example, one call may return 2022-12-31 and the second 2023-01-01. This can lead to some really nasty intermittent errors that are every hard to track down and repair the damage to your DB!