So I would ignore most guides out there on the internet as they use the older enableForgroundDispatch
API which is bad for writing to Tag's
So https://stackoverflow.com/a/64921434/2373819 give you the basics of NFC writing using the newer and better API but for Ndef, whereas you need to use the low level NfcA transceive
method to read and write individual memory areas instead of Ndef. The datasheet for the Tag give the details of set of bytes to send as commands to achieve this.
https://stackoverflow.com/a/59397667/2373819 is another example but shows how to use NfcA
transceive
But you must understand that all NFC interactions are driven by Tag detection when the Tag is physically moved in to range. Thus doing something only on button push is harder.
You need to do either or both of the following.
Push button prompt user to bring the Tag in to range, read/write data.
When Tag comes in to range, store the Tag object and then use it when the button is pushed and handle the error if the Tag has already gone out of range (at which point you could prompt the user to bring the Tag back in to range as per 1)